Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI( tns ) Only can deploy first time to Real IPhone device, please help :( #1398

Closed
enchev opened this issue Jan 15, 2016 · 66 comments
Closed
Assignees
Labels
Milestone

Comments

@enchev
Copy link
Contributor

enchev commented Jan 15, 2016

From @wisonye on January 15, 2016 7:22

When developing, I use the this command to run in Emulator, everything is fine:

tns livesync ios --emulator --device "iPhone 5" --watch

But after I want to test on real IPhone device, I run

tns run ios

It ONLY CAN WORKS for the first time, after that, it always DEPLOY FAIL with this error:

Results at '/Users/wison/NativeScriptProject/DemoMobileApp/platforms/ios/build/device/DemoMobileApp.ipa' 
Project successfully built
Using  /Users/wison/NativeScriptProject/DemoMobileApp/platforms/ios/build/device/DemoMobileApp.ipa
Unable to start service com.apple.mobile.installation_proxy. Result code is: 3892314239

I really have no idea on this, and the weird thing is keep going: After I unplug the IPHONE, the "tns device" command still can LIST my iphone( how could that possible ):

Wisons-MacBook-Pro:DemoMobileApp wison$ tns device
┌───┬─────────────┬──────────┬──────────────────────────────────────────┐
 #  Device Name  Platform  Device Identifier                        
 1  iPhone5,2    iOS       4fcae2e62d5bd99d901647c84b78a3259f71f9ed 
└───┴─────────────┴──────────┴──────────────────────────────────────────┘

Anybody can help on this ??? :)

Copied from original issue: NativeScript/NativeScript#1379

@Fatme
Copy link
Contributor

Fatme commented Jan 15, 2016

Hi @wisonye,

Can you try to restart your device and run the command again?

@wisonye
Copy link

wisonye commented Jan 15, 2016

@Fatme I found a tips, after restart my MacOSX, then plugin the IPhone, and the default "Photos" app will open( automatic ), IF I DON'T CLOSE Photos app, "tns run ios" works for more times, if I close it, just fail, I just found this, not sure it's the real reason, still confusing on this :)

@Fatme
Copy link
Contributor

Fatme commented Jan 15, 2016

It's a really strange. Can you check if Sync with this iPhone over Wi-Fi option is turned on from your iTunes?

@alpipego
Copy link

I have a similar problem. Where I get the same error message:

Unable to start service com.apple.mobile.installation_proxy. Result code is: 3892314239

After unplugging the phone tns device does still list the phone, it is not visible in Xcode → Window → Devices however.

Edit
I opened iTunes and checked 'Sync over WiFi' - applied - then unchecked this option - applied again - closed iTunes and now tns device completely hangs (Ctrl+C does nothing), regardless if the iPhone is connected or not.

@alg
Copy link

alg commented Jan 28, 2016

It's curious, but I got rid of the error by stopping a ton of apps (mostly games) my son started while I was away. Got to the springboard-only state and it started installing everything smoothly.

@aylesm
Copy link

aylesm commented Feb 3, 2016

I frequently get this issue:

Successfully deployed on device 204ea16234def71a7e7813d9e7490e54b0037b73
Unable to start service com.apple.mobile.installation_proxy. Result code is: 3892314239

Nothing mentioned here works a 100% of the time.

@rleclair65
Copy link

Same problem with iPad4,1. No solution mentioned works. I start my ios app my xcode.

@wisonye
Copy link

wisonye commented Feb 3, 2016

@rleclair65 Yep, you're right, when "tns" sometime happy, sometime is not happy, the finally helper is XCode, 100% can install and run on IOS Device :) And XCode also fixed the "Black launch screen" issue as well :)

@aylesm
Copy link

aylesm commented Feb 4, 2016

I found that in my terminal if I list the processes and kill the forked server process it helps. For example run:
ps
to get the list of processes. It should give you something like:

PID TTY TIME CMD
496 ttys000 0:00.47 -bash
2660 ttys000 0:00.26 adb -P 5037 fork-server server --reply-fd 4

Then kill fork-server like this:
kill 2660

@alg
Copy link

alg commented Apr 19, 2016

@aylesm How adb is related to iOS?

@spstratis
Copy link

Has there been any further updates on this?

@enchev
Copy link
Contributor Author

enchev commented May 31, 2016

Hey @spstratis what is your CLI version?

@enchev enchev closed this as completed Jun 7, 2016
@manijak
Copy link

manijak commented Jun 18, 2016

Someone care to explain why this is closed and no permanent solution provided?

I have this issue on CLI 2.0.1

@enchev
Copy link
Contributor Author

enchev commented Jun 20, 2016

Hey @manijak,

I asked for more info however never got a response. Hey @dtopuzov @vchimev can you confirm this?

@manijak
Copy link

manijak commented Jun 20, 2016

It's a verry odd issue. I had an ipad in the other room that had sync over wifi enabled. So it appeared in the device list all the time, even after I disabled the sync.
Had to turn off wifi on the device for it to go away, restarted my Mac and now it works...

@dtopuzov
Copy link
Contributor

@manijak we had several issues when deploy/run/debug on real device when --device option is specified. Those issues should be resolved in 2.1.0 (it will be available at the end of this month).

If you still experience some issues with 2.1.0, please reopen or report new issue.

@christocracy
Copy link

I just got this error with 2.1.1. Closed iTunes and it worked.

@avatsaev
Copy link

Got this error on 2.3.0 (released today 15 sep 2016)
can't deploy on real device

executed command: tns deploy ios --device 1

here is the log trace: https://gist.github.com/avatsaev/fdb34ca396a47de2ff65e8bfcb6ca4a5

@ignaciolarranaga
Copy link

ignaciolarranaga commented Sep 17, 2016

Had the same problem with 2.3.0 too. Seems it is not yet solved.

@andreasotto
Copy link

I can confirm the problem still exists (for a long time now ;-( ).
Rebooting the iPhone temporarily helps, as exactly one install on the phone is possible then.

But this is far from a solution, one can't reboot the phone for every deploy!

# tns run ios --device 1
[....]
Project successfully built
Unable to start service com.apple.mobile.installation_proxy. Result code is: 3892314239

I'm currently in the process from changing from Ionic to NativeScript, but this issue definitively stops me being productive. And knowing that this issue exists since nearly a year makes me scared. If there is anything i could help with, let me (us) know.

@xerotolerant
Copy link

Closing Itunes worked once. It hasn't really worked since. I use ipa-deploy on the side but even that is a a little inconvenient. Is there a way to force disconnect devices in the command line?

@andreasotto
Copy link

andreasotto commented Sep 28, 2016

Closing iTunes makes no difference. I have to reboot the iPhone everytime i would like to run or deploy the app again. That makes the development cycle terrible. Is there no help in sight? Do we know if the NativeScript people at least work on this issue?

@xerotolerant
Copy link

Wait, try ejecting you iPhone from iTunes and closing the app on the device
completely. That works for me off and no. Not 100% of the time but often
enough that I try it before i use ipadeploy.

On Wed, 28 Sep 2016 at 12:38 PM andreasotto notifications@github.com
wrote:

Closing iTunes makes no difference. I have to reboot the iPhone everytime
i would like to run or deploy the app again. That makes the development
cycle terrible. Is there no help in sight? Do we know if the NativeScript
people at least work in this issue?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1398 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQaDGJ3Zf-PlJzMl6sEgrtlKBwol1udTks5qupf0gaJpZM4HFjgM
.

@andreasotto
Copy link

andreasotto commented Sep 28, 2016

I just created a completely new app with the create command. That app is not running on the phone and doesn't need to be stopped. I disconnect the phone from iTunes and closed iTunes.

Because i already had run another app before, i run into the error again:

...
Project successfully built
Unable to start service com.apple.mobile.installation_proxy. Result code is: 3892314239

It's everytime the same. The only solution is to completely switch off the phone (reboot), what isn't a "solution" at all. I don't know how to to keep on developing. In bought an android phone to go on with developing, but thats not a solution, too - because now i'm in debugging iOS and i'm rebooting the phone like 20 times a day.

@dtopuzov
Copy link
Contributor

Hi All,

In {N} 3.0.0 we changed communication with iOS devices and I can not reproduce the issue.

Can you please try {N} 3.0.0 RC and let us know if you still experience the issue.

npm uninstall -g nativescript
npm i -g nativescript@rc
tns create MyApp --template tns-template-hello-world@rc
tns platform add ios@rc --path MyApp
tns plugin remove tns-core-modules --path MyApp
tns plugin add tns-core-modules@rc --path MyApp
tns run ios --path MyApp

@dtopuzov
Copy link
Contributor

dtopuzov commented May 4, 2017

@davek1979 @odubuc @demetrio812 @Roar1827 {N} 3.0.0 is now live, so you can test directly with official version.

@vultix
Copy link

vultix commented May 10, 2017

I've just updated to {N} 3.0.0 and am still seeing this issue.

> tns run ios

Skipping prepare.
Searching for devices...
Skipping package build. No changes detected on the native side. This will be fast!
Multiple errors were thrown:
Could not start service com.apple.mobile.installation_proxy

@pkoleva
Copy link
Contributor

pkoleva commented May 11, 2017

Hey, @vultix ,
Would you try to deploy and run the app from XCode on your device and check if it is ok. If it is, then run
tns run ios --log trace
and paste us the result in the console here, so we can try to find the specific problem.
Thanks!

@tylerdoll
Copy link

tylerdoll commented May 12, 2017

@pkoleva I too am having this issue and it is becoming a real pain to deal with. I ran the command you mentioned to @vultix. Here is my log output. Sometimes I can fix it by unplugging and restarting my phone then running tns platform remove ios && tns platform add ios && tns build ios && tns run ios.

  • What's the version of your Mac OS X? 10.11.6
  • What's the version of your XCode ? 8.2.1
  • What's the version of iTunes that you have installed? 12.6
  • When you reproduce the issue, do you have more than one connected devices? No
  • Do you have iOS Simulator running while you reproduce the issue? Sometimes. Usually it happens when I switch from the simulator to my actual device
  • What's the output of tns device command when you reproduce the issue?
    1 │ Tyler's iPhone │ iOS │ def8a5215aa87d83776f0a7be535b98778cb840e │ Device │ Connected
  • Do you reproduce the issue when you do not use the --device option? Yes
  • Do you have Sync with this iPhone over Wi-Fi option enabled in iTunes for ANY of your devices? Tried it both ways and still didn't work
  • When you reproduce the issue - how many devices do you see connected in iTunes? 1

@vultix
Copy link

vultix commented May 12, 2017

@pkoleva Sorry for taking so long to respond. Coming back the next day to try to reproduce the error I have been unable to. I will let you know if it resurfaces. When it happens it is very difficult to manage.

@pkoleva
Copy link
Contributor

pkoleva commented May 15, 2017

Hey, @tylerdoll,

Thank you for the detailed report, but just to make sure we are on the same page - you use nativescript 3.0.0 (3.0.1 is the latest if you haven't tried it you can give it a go) and your steps to reproduce are:

  1. You run the app on a simulator with tns run ios -> the app is built and deployed successfully
  2. Immediately after that you try to run the same app on a paired device with the same command tns run ios -> the app skips prepare and build and could not be deployed to the device.

It will be very helpful if you can send us this app's package.json and also if you verify that the same app can be deployed to the device from XCode (in app/platforms/ios there is a xcodeproj file you can use to do so)

Thanks!

@pkoleva
Copy link
Contributor

pkoleva commented May 15, 2017

@tylerdoll, I've consulted with our developers and searched the closed issues and it seems like the problem you are facing is actually with iTunes. The solution is to disable Wi-fi Sync in iTunes for this device, judging from the error code it seems to not support it. Another way to try this is to stop the Wi-fi on this device and try again.
Hope one of these helps!

@toddanglin
Copy link

I can confirm that I also encounter this problem with {N} 3.0.1 and XCode 8.3.2.

The problem started after LiveSync caused the app to encounter an error on launch. After that error, any attempt to re-run the app has failed.

The target iPad does not have WiFi sync in iTunes enabled, and I also disabled Wifi on the device. To resolve, I had to unplug and then reconnect the USB connection to the iPad. After doing that, I was able to redeploy and run the app.

I'll attempt to create an smaller demo project that can recreate this error condition. Hopefully we can find a way to further minimize this edge case error...

@ahmadsyamim
Copy link

After reboot device, 'Error is: InstallationLookupFailed.'

@jrz
Copy link

jrz commented Aug 21, 2017

Error is: Could not start service com.apple.mobile.installation_proxy.
Turned wifi off.
Now: Error is: Could not start device session.

Now suddenly it works.

@speigg
Copy link

speigg commented Sep 28, 2017

I've also been encountering this problem on nativescript v3.2.1 (Xcode 9):

Unable to apply changes on device: 4e025c1c924ddc3c69c797d2a82c3ed75adfc4d7. Error is: Could not start device session.

@hosikiti
Copy link

hosikiti commented Dec 15, 2017

I've also been encountering this problem since the beginning of December while deploying to simulator and deploying through XCode9.2 works.

Error message on tns run ios

Installing...
Unable to apply changes on device: 5f7a1717923abc2ac017b0d0992eadd4b5573a5a. Error is: InstallationLookupFailed.

My environment:

┌──────────────────┬─────────────────┬────────────────┬───────────────┐
│ Component        │ Current version │ Latest version │ Information   │
│ nativescript     │ 3.3.1           │ 3.3.1          │ Up to date    │
│ tns-core-modules │ 3.3.0           │ 3.3.0          │ Up to date    │
│ tns-android      │                 │ 3.3.1          │ Not installed │
│ tns-ios          │ 3.3.0           │ 3.3.0          │ Up to date    │
└──────────────────┴─────────────────┴────────────────┴───────────────┘

@hosikiti
Copy link

My problem solved. It seems "Enterprise Distribution" is a cause of this issue. Enterprise app needed to be "trusted" from control panel before use. However, tns run command deletes an installed old app every time before installing new one, and "trusted" information is always reset. Because of that tns run cannot launch newly installed app.

What I did to fix (just for anyone who is facing same kind of issue):

  1. Create iOS development certificate, app id, and provisioning profile.
  2. Install the certificate and the provisioning profile to my local machine.
  3. Run tns build ios --provision to know the provision ID of newly installed provisoning profile.
  4. Run tns device ios to know my iPhone's device ID.
  5. Run `tns run ios --device --provision
  6. Done!

@sean-nicholas
Copy link

I had this problem with the simulator. I solved this by checking out my initial commit, running tns run ios (issue is gone) and then re-checkout my last commit. Everything worked again. Strange 🤔

Fatme added a commit to NativeScript/ios-device-lib that referenced this issue Apr 10, 2018
Current behaviour:
Sometimes devices connected by wifi are reported as found. This leads to some unpredictable behaviour when livesync is executed.

New behaviour:
Only devices connected by usb are reported as found.

NativeScript/nativescript-cli#1398
Fatme added a commit to NativeScript/ios-device-lib that referenced this issue Apr 10, 2018
Current behaviour:
Sometimes devices connected by wifi are reported as found. This leads to some unpredictable behaviour when livesync is executed.

New behaviour:
Only devices connected by usb are reported as found.

NativeScript/nativescript-cli#1398
@Fatme Fatme added this to the 4.1.0 milestone Apr 13, 2018
@dtopuzov dtopuzov self-assigned this May 18, 2018
@dtopuzov
Copy link
Contributor

Wifi devices not longer detected by tns.
Will be released in nativescript@4.1.0

@stevegardnersa
Copy link

I've skimmed through the above comments and didn't see my solution but sorry if it's a repeat. I found this problem was caused by a non original iPhone cable. As soon as I switched to an original cable the error stopped.

The error I was getting was...

Unable to apply changes on device: XXXXXXXXXXXXXXXXXX. Error is: Could not start service com.apple.mobile.installation_proxy.

@marcosnc08
Copy link

marcosnc08 commented Apr 16, 2019

Hi ! I'm having this issue.

"nativescript": { "id": "blah blah blah", "tns-ios": { "version": "5.0.0" }, "tns-android": { "version": "5.3.1" } },

The error is

Error detected during LiveSync on "device id" for "path to app folder". Error: InstallationLookupFailed

I disabled wi fi sync for the device on iTunes but nothing changed.

Any ideas on how to solve this?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests