Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17595] iOS: The app fails to install on iOS device after a second iOS device is also plugged in

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-09-08T18:07:39.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sRelease 3.4.0, Release 3.5.0
ComponentsCLI, iOS
Labelslook1, merge-5.0.x, qe-3.4.0, regression
ReporterSatyam Sekhri
AssigneeChris Barber
Created2014-09-02T10:23:09.000+0000
Updated2018-08-06T17:49:23.000+0000

Description

The app does not install to the first iOS device after the second iOS device is also attached in the system. This is a regression as the issue does not exist with SDK 3.3.0.GA The issue occurs on 3.3.0 CLI as well with 3.4.0.x SDK Steps to Reproduce: 1. Attach a development iOS device to the system. 2. For any mobile project, either install the project through studio or run the following cli command "ti build -p ios -T device -C " 3. The app gets installed successfully 4. Now plug in another iOS device to the system. 5. Again try to install the same project to the first device In CLI the build is successful but the process terminates without installing the app. In studio the installer process terminates after the console shows "[INFO] : Image optimization complete" Note: If at this point we try to install the same app on device 2, it is successful. However, if we unplug and plug the device 1 again then it does not install on device 2 now but does so on device 1. In trying to reproduce this, there are times when the node-ios-device library fails to connect to the device or start the syslog_relay service:
Trying to build and run apps on the iOS8 device yields:
[TRACE] :  ** BUILD SUCCEEDED **
[INFO] :   Installing app on device: Mark's iPhone
[ERROR] :  Failed to start "com.apple.syslog_relay" service (0xe800007f)
[ERROR] :  Project failed to build after 37s 599ms
There are also times when node-ios-device crashes with a segmentation fault.

Comments

  1. Wilson Luu 2014-09-03

    Was able to reproduce this issue (from Studio and CLI) *only* for the case where I plugged in an iOS 8 device first, then an iOS 7 device second. I was *not* able to reproduce this issue if I plugged in an iOS 7 device first, then an iOS 8 device second. *Note:* - When I reproduced the issue from Studio and CLI, the last log that prints out before terminating is *BUILD SUCCEEDED*. - While reproducing the issue on Studio, I did not click on the *Refresh Devices* option. After plugging in the second device (whether that be an iOS 8 or 7 device) and installing the same app to the first device, the plugged in devices will show up in the device list. *Tested on:* Appcelerator Studio, build: 3.4.0.201409021758 SDK: 3.4.0.v20140829184521 CLI: 3.4.0-dev Alloy: 1.5.0-dev Xcode: 6-beta7 Devices: ipad 4 (8.0-beta5), iphone 5 (7.0.6)
  2. Satyam Sekhri 2014-09-04

    The issue is not reproducible only when the first device is an iPhone and second device is an iPad, irrespective of the OS version. Following is the matrix of the device combination tested and the results || First Device || Second Device || Issue Reproducible || | iPhone 5S (v8.0 beta5) | iPhone 4 (v7.1.2) | Yes | | iPhone 4 (v7.1.2) | iPhone 5S (v8.0 beta5) | Yes | | iPhone 5S (v8.0 beta5) | iPad 4 (v8.0 beta 5) | No | | iPhone 4 (v7.1.2) | iPad 4 (v8.0 beta 5) | No | | iPad 4 (v8.0 beta 5) | iPad 2 (v7.1.2) | Yes | Tested On: Appcelerator Studio, build: 3.4.0.201409021758 SDK: 3.4.0.v20140903121714 CLI: 3.4.0-beta Alloy: 1.5.0-beta Xcode: 6-beta7
  3. Chris Barber 2014-09-10

    I was able to reproduce this (I think). I built an app for an iOS 8 device, then an iOS 6 device. The first build for the iOS 8 device built and installed perfectly. The second build for the iOS 6 device built, but failed to install with an error saying that it couldn't start the syslog_relay service. This is an error returned by node-ios-device. I tried building again and received an error saying that node-ios-device was unable to connect to the iOS 6 device. Building a 4th time (3rd time on the iOS 6 device) and it built and installed successfully. Not sure what to do about this. It's not consistent. Creating a new app doesn't appear to matter. I suspect that there may be an internal issue in node-ios-device where something in MobileDevice is not properly shutdown. Currently, there is no cleanup when the build completes. When the CLI terminates, node-ios-device is forced to terminate in whatever state it is in.
  4. Mark Mokryn 2014-09-11

  5. Ingo Muschenetz 2014-09-11

    [~ssekhri] (and others) if you get this to fail, please attach the full TRACE-level log output.
  6. Satyam Sekhri 2014-09-12

    With the latest 3.4.x SDK (3.4.0.v20140911135715), the issue does not occur anymore. Environment: SDK: 3.4.0.v20140911135715 Studio: 3.4.0.201409111151 CLI: 3.4.0-rc2 Xcode: Xcode 6 GM seed
  7. Ingo Muschenetz 2014-09-12

    [~skypanther] to code review. [~wluu] to FR.
  8. Chris Barber 2014-09-13

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/6071 3_4_X pull request: https://github.com/appcelerator/titanium_mobile/pull/6072 To test, do many, many iOS device builds. Test installing on multiple devices. Test disconnecting a device during installation. Test installing and swapping devices. TEST! TEST! TEST!
  9. Tim Poulsen 2014-09-14

    Tested with iPad 2 and iPad 4 following initial steps to reproduce plus Chris's comments. In every case, no errors were output and apps were installed as expected. PRs merged.
  10. Satyam Sekhri 2014-09-15

    Test build the project multiple times on multiple devices with none, one or two devices plugged in different combination. The build and install on devices/itunes successful. Tested On: SDK: 3.4.0.v20140913174915 Studio: 3.4.0.201409131030 CLI: 3.4.0-rc3 Alloy: 1.5.0-rc2 Xcode: Xcode 6 GM seed Devices: iPhone 5s (v8.0 GM), iPad 4 (v8.0 GM), iPhone 4 (v7.1.2)
  11. Mark Mokryn 2014-10-10

    This should be reopened. I'm still seeing Failed to start "com.apple.syslog_relay" service (0xe800007f) with 3.4.0.GA and CLI 3.4.0
  12. Chris Barber 2014-10-10

    [~mokesmokes] This is such a hard issue to reliably reproduce, let alone fix it. I tried dozens of times to fix it, but the act of rebuilding and reinstall an app rarely triggers the problem. The code used to work fine before Xcode 6 and iOS 8. I had an iOS 6 and iOS 8 test device, but I can't remember which one (or both) had the problem. I suppose I could try to start the syslog_relay service and if it doesn't work, wait and try again a few times before giving up. Feels hacky, but at least saves you the time of re-building the entire app. That functionality change would require a new ticket, not this ticket.
  13. Mark Mokryn 2014-10-10

    Chris not sure how to reply to that..... rebuilding usually doesn't work. Sometimes disconnecting and reconnecting the device and then rebuilding works. Sometimes (I think) a device reset is required..... would be nice to at least get a concrete set of workarounds. From what I saw, once it happens it's a pain to get a good device build.
  14. Chris Barber 2014-10-10

    [~mokesmokes] I hear ya. The only workaround that I know besides keep rebuilding is to use the iTunes sync, which is ultra painful. I don't love that reconnecting the device sometimes works. I should mention that when I was running into this, I was invoking node-ios-device directly from the command line using a pre-built app. I was able to install many times much faster.
  15. Mark Mokryn 2014-10-11

    [~cbarber] can you please describe the usage of node-ios-device? Thanks.
  16. Moshe Marciano 2014-10-13

    I am getting "com.apple.syslog_relay" service (0xe800007f) with 3.4.0.GA and CLI 3.4.0 too
  17. Chris Barber 2014-10-13

    [~mokesmokes] To manually run node-ios-device, edit the following file:
        ~/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/ioslib/node_modules/node-ios-device/test/test-installApp.js
        
    There's 2 things you can change: 1) Change the path to the app to be installed. You must first build the app, then input the path to the <project-dir>/build/Debug-iphoneos/<name of app>.app directory. 2) Change the setTimeout()'s timer from 25000 (25 seconds) to 0 (was testing a bug where the iphone disconnects after 20 seconds of inactivity) Next, open a terminal and run the test-installApp.js script:
        node ~/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/ioslib/node_modules/node-ios-device/test/test-installApp.js
        
    That should kick start the app being installed directly to the device. You should be able to retry the install quickly.
  18. Cyprian Kowalczyk 2014-10-19

    Here is the solution that worked for me: First I run *unmodified* test-installApp.js so I could see the device logs in the terminal: {noformat} node ~/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/ioslib/node_modules/node-ios-device/test/test-installApp.js {noformat} After inspecting it I discovered this: {noformat} Oct 19 11:17:21 iPhone mobile_installation_proxy[2499] : LaunchServices: installing app with unknown bundleID Oct 19 11:17:21 iPhone installd[2497] : 0x10050c000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/FaveBooks.app" type Developer requested by mobile_installation_proxy (pid 2499) Oct 19 11:17:21 iPhone installd[2497] : 0x10050c000 -[MIInstaller performInstallationWithError:]: Installing Oct 19 11:17:21 iPhone misagent[2505] : attempt to install invalid profile: 0xe8008012 Oct 19 11:17:21 iPhone installd[2497] : 0x10050c000 -[MIInstallableBundle _installEmbeddedProfileInBundle:]: Could not install embedded profile: 0xe8008012 (Unsupported device) Oct 19 11:17:21 iPhone installd[2497] : SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName] Oct 19 11:17:21 iPhone installd[2497] : entitlement 'application-identifier' has value not permitted by provisioning profile 'iOSTeam Provisioning Profile: pl.ironin.storemanager' Oct 19 11:17:21 iPhone installd[2497] : 0x10050c000 -[MICodeSigningVerifier performValidationWithError:]: 186: Failed to verify code signature of : 0xe8008016 (Entitlements found that are not permitted by provisioning profile) Oct 19 11:17:21 iPhone installd[2497] : 0x10050c000 -[MIInstaller performInstallationWithError:]: Verification stage failed {noformat} It appeared that Titanium Studio was using incorrect provisioning profile (pl.ironin.storemanager) to sign pl.ironin.favvebooks. After setting correct profile the app installed flawlessly :)
  19. Luis F. Garcia 2014-10-21

    I got the same Issue: [ERROR] : Failed to start "com.apple.syslog_relay" service (0xe800007f) I just disconnected the iPhone and connect it again. After this I was able to install my app.
  20. Joseph Sachs 2014-10-24

    @Luis F. Garcia - Yep that worked for me :) Thanks.
  21. Mark Mokryn 2014-10-24

    [~ underlabs] don't get too optimistic - sometimes unplugging the phone helps, sometimes not.... sometimes rebooting the phone.... I have had cases where I needed to reboot both Mac and phone, etc.....
  22. Fokke Zandbergen 2014-12-09

    Still get this with 3.4.1.GA
  23. Ingo Muschenetz 2014-12-09

    [~fokke] is there any difference between what you do and the test case?
  24. Fokke Zandbergen 2014-12-11

    [~ingo] in my case there's no second device plugged in and unplugging and then plugging back in the device (sometimes multiple times) solves it. The device is connected via a (good) USB hub. When the build starts it doesn't complain the targeted device is not found, only when it tries to actually install to it. Seems to be some kind of connectivity problem.
  25. Chris Barber 2014-12-11

    [~fokke] I've had issues with iOS devices going through hubs too. I'm not sure exactly what the problem is. Connecting the device directly to my Mac solved the problem.
  26. Fokke Zandbergen 2014-12-12

    Well, yes.. but with many test devices linked up my MBP's 2 USB ports are not going to be enough ;)
  27. Fokke Zandbergen 2014-12-12

    [~cbarber] just had this on an iPad directly connected to my MBP as well :(
  28. Brenton House 2015-02-28

    Getting this on MBP w/ iPhone 6+ connected via USB. Using Ti SDK 3.5.0.GA
  29. kosso 2015-03-06

    I have just started getting this. Using Ti SDK 3.5.0.GA - But oddly, it was working fine a few days ago an I'm pretty sure I haven't updated anything. Simulator runs fine. Building to devices gives : ..etc..etc.. [INFO] : Invoking xcodebuild [INFO] : Image optimization complete [INFO] : Installing app on device: iPhone [ERROR] : Failed to install app on device (0xe8008018) [ERROR] : Project failed to build after 1m 47s 393ms [ERROR] : Failed to install app on device (0xe8008018) What gives?
  30. kosso 2015-03-06

    .. this happens on brand new Titanium Mobile App projects too, as well as existing ones.
  31. Mark Goddard 2015-04-16

    I am also seeing this issue. I can consistently reproduce the error though by switching Personal Hotspot on and off. Switch it off and the app builds and installs fine, switch it on and I see: [ERROR] : Failed to start "com.apple.syslog_relay" service (0xe800007f) [ERROR] : Project failed to build after 42s 639ms [ERROR] : Failed to start "com.apple.syslog_relay" service (0xe800007f) With no way it seems to get around it.
  32. Alberto Marcone 2015-04-20

    still happening over here. It was working like 5 minutes ago and now it's broken.
  33. Fokke Zandbergen 2015-04-21

    Also found again by this Q&A user: https://community.appcelerator.com/topic/202/failed-to-start-com-apple-syslog_relay-service
  34. josh rose 2015-04-22

    Also happening to me intermittently but frequently...
  35. Zishan Khan 2015-05-05

    Also happening to me. Any update?
  36. Ygor Lemos 2015-05-15

    This also happens on Ti SDK 4.0.0 RC1, RC2, RC3 and RC4 intermittently.
  37. John Marott 2015-06-28

    It also happens here: Operating System Name = Mac OS X Version = 10.10.3 Architecture = 64bit # CPUs = 4 Memory = 17179869184 Node.js Node.js Version = 0.12.3 npm Version = 2.9.1 Titanium CLI CLI Version = 4.0.1 Titanium SDK SDK Version = 4.0.0.RC5 SDK Path = /Users/jma/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.RC5 Target Platform = iphone [INFO] : Installing app on device: jma iPhone [ERROR] : Failed to start "com.apple.syslog_relay" service (0xe800007f) [ERROR] : Project failed to build after 46s 444ms [ERROR] : Failed to start "com.apple.syslog_relay" service (0xe800007f) TRACE | titanium exited with exit code 1 ERROR | Error: ti run exited with error code 1 at ChildProcess. (/Users/jma/.appcelerator/install/4.0.2/package/node_modules/appc-cli-titanium/plugins/run.js:84:66) at ChildProcess.emit (events.js:110:17) at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
  38. Abdiel Aviles 2015-08-30

    Happens continuously... cannot run on my device. Very frustrating. [EDIT] Here's my workaround "ritual": 1- Unplug your device 2- Clean the project 3- Log out Appcelerator 4- Re-open Appcelerator and log in 5- Plug your device 6- Run the app
  39. Fokke Zandbergen 2015-08-31

    5.0 has a complete rewrite of the iOS build/libs and should improve this a lot.
  40. Tobias Høegh 2015-08-31

    ok then. Looks like we have to wait. The latest beta is 4.2 - have a look: http://preview.appcelerator.com/appc-studio/ But, is it possible to check out 5.0?
  41. Chris Barber 2015-09-03

    [~abdielou] You should not have to log out of the Appcelerator network to fix this. Generally, these errors are not Appcelerator or Titanium specific. The problem is happening in Apple's MobileDevice framework. If you see a hexadecimal number, such as 0xe800007f, then paste that into Google and you will almost always find a ton of other people reporting the same problem from iTunes or Xcode. Sometimes the error is due to provisioning profiles. Sometimes it's do to entitlements. The errors vary and are largely undocumented. Usually unplugging and reconnecting your device fixes this. Sometimes rebooting your iOS device will fix it. Other times, you need to check your provisioning profiles. You should never have to restore your device.
  42. Abdiel Aviles 2015-09-04

    @cbarber I said it was a "ritual". But as you said, the errors vary and are "largely undocumented", so I'm happy to do a cleaning ritual. Anyways, depending on how quirky things get with Appcelerator, at times I end up killing various node instances that have spun off and would not die with the studio shutdown. The sad thing is I have to do this quite often, and believe me, I'd be happier not having to cycle through this. For example, I've just lost 30 minutes this morning trying the plug/unplug solution and ended up cycling and killing node instances.
  43. Fokke Zandbergen 2015-09-07

    PR for improved error message: https://github.com/appcelerator/titanium_mobile/pull/7129
  44. Fokke Zandbergen 2015-09-08

    PR on 5: https://github.com/appcelerator/titanium_mobile/pull/7143
  45. Joseph Sachs 2016-06-04

    Been having this issue all day today. Note, I updated recently to Studio 4.6.0.201605201934 and SDK 5.3.0.GA. I've done the workaround "ritual" listed above: 1- Unplug your device 2- Clean the project 3- Log out Appcelerator 4- Re-open Appcelerator and log in 5- Plug your device 6- Run the app & it worked.
  46. Lorenzo Piccinini 2016-06-11

    I have the same problem but the workaround doesn't work for me. Here there is another use with the same problem http://stackoverflow.com/questions/37750914/titanium-cant-build-for-device-com-apple-syslog-relay-error
  47. Chris Barber 2016-06-11

    [~otto.pic] this should be fixed in TiSDK 5.3.0.
  48. Lorenzo Piccinini 2016-06-11

    Are you sure? I'm using it. Studio 4.6.0.201605201934 and SDK 5.3.0
  49. Chris Barber 2016-06-12

    [~otto.pic] I fixed a couple of bugs in node-ios-device (https://github.com/appcelerator/node-ios-device/commit/4ad18fa814c698271290c6a2fa21b6205805dc6c) and one of which was a race condition that caused the syslog relay error. I published v0.9.5 to NPM and updated ioslib to v0.11.0. However, upon further investigation, it appears that 5.3.0.GA uses ioslib v0.10.4 which does not include the fix. Bummer. The fix was likely done after 5.3.0 code freeze, but 5.3.0 had an extended testing period, so it is easy to forget when exactly it was merged. The fix will be in 5.4.0... whenever that is released.
  50. Ygor Lemos 2016-06-16

    This bug started happening to me and some other developers here again. We have tried everything and nothing solves it whatsoever. Other Ti apps compile and get installed normally on the same machines. We are using 5.3.0.GA Haven't seen it since Ti 4.X Isn't it critical enough for a quick minor release to 5.3.X ?
  51. Ygor Lemos 2016-06-17

    I have managed to fix it just now by doing the following steps: 1 - Download Apple Configurator 2 from the Mac App Store 2 - Access iOS Device (iPhone in my case), go to the Profiles tab and delete ALL profiles 3 - After removing all profiles, disconnect iPhone from Mac 4 - Re-generate the Developer Mobile Provisioning Certificate on Apple Developer portal (manually, not through Xcode) 5 - Download the mobile provision file and click on it 6 - Reboot the Mac (important) 7 - Reboot the iPhone (important) 8 - Re-connect the iPhone (if it asks for Trusting the Computer again, confirm it) 9 - Build it with: ti build -p ios -T device -C IPHONE_DEVICE_UDID It worked! I have tried several combinations of those steps but this sequence is the only one that has worked properly.
  52. Chris Barber 2016-06-17

    [~ygbr] The ultimate problem is there is a race condition inside the node-ios-device library that Titanium uses. Even if you do all those steps, it's completely possible that it will happen again. I believe the best thing to do is reconnect your device and retry the build until you get lucky. The good news is this bug has been fixed! The bad news is it's not yet shipped with a GA Titanium release. The next release of Titanium will include the updated node-ios-device. On a side note, I also fixed node-ios-device to work with Node 6.
  53. Ygor Lemos 2016-06-17

    @Chris Barber indeed it happened again after some builds... Is there any chance of this fix getting into 5.3.1.GA? Just read on Appcelerator blog you're releasing a RC today...
  54. Chris Barber 2016-06-17

    [~ygbr] I not sure if this will make 5.3.1.GA or if you have to wait until 5.4.0.GA. However, I have a workaround. Find your Titanium SDK 5.3.0.GA installation directory. It is probably ~/Library/Application Support/Titanium/mobilesdk/osx/5.3.0.GA. Inside that directory, edit node_modules/ioslib/package.json. Change the node-ios-device version from 0.8.3 to 0.9.5. Next delete the node_modules directory in the ioslib directory. Finally, navigate to the ioslib directory from the Terminal and run npm install. You should be good to go.
  55. Caio Perdona 2016-06-21

  56. Chris Barber 2016-06-21

    [~perdona] What version of Node.js? OS X I presume? How can I reproduce?
  57. Caio Perdona 2016-06-21

    Yes, OSX. Node v5.11.1 Did all of the above, then when I run:
        appc setup
        
    I get
        You have the latest Titanium SDK release 5.3.0.GA
        2016-06-21T22:03:49.177Z | ERROR  | invalid config results returned from titanium. (JSON parse error)
        
  58. Chris Barber 2016-06-21

    [~perdona] Sounds like you're running into CLI-780. I don't have any fix for you, so you may want to try to uninstall and re-install the Appc CLI.
  59. Alberto Marcone 2016-07-11

    I'm so sick of this bug that you can't even imagine. None of the workarounds worked for me. Titanium has been the worse ride of my life.
  60. Dragos Perca 2016-07-14

    I was having the same issue but the fix suggested by Chris Barber (node-ios-device vs 0.9.5) seems to resolve it. Thank you
  61. Joseph Sachs 2016-08-01

    I tried the workaround that [~cbarber] mentioned with node-ios-device ver 0.9.5... however, when I run on device, console is stuck on: [INFO] : Installing app on device: myDevice and stays like this forever. UPDATE: Closing Appcelerator and Reopening it... worked ;)
  62. Chris Barber 2016-08-01

    [~underlabs] Yeah, there's a seg fault (TIMOB-23671) in node-ios-device 0.9.x that I fixed in 0.10.x, but now I'm actively working on fixing a deadlock issue. I'm hoping to have a fix asap.
  63. Joseph Sachs 2016-08-01

    Hi [~cbarber] It actually worked now... I re-opened Appcelerator... not sure if it was luck :p
  64. Caio Perdona 2016-08-16

    Is it fixed on 5.4.0.GA?
  65. Chris Barber 2016-08-16

    [~perdona] No, unfortunately the fix missed the 5.4.0.GA train. It will be in 5.5.0.GA.
  66. Caio Perdona 2016-08-25

    This is critical and really depressing, cause we can't debug our iOS devices on the go, and its causing us to take more time to ship our products..
  67. Chris Barber 2016-08-25

    [~perdona] Titanium SDK 5.5.0 beta is available and has the fix for this. Give a try: https://www.appcelerator.com/blog/2016/08/beta-release-for-titanium-sdk-5-5-0-appcelerator-cli-5-5-0/.
  68. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source