[TIMOB-17595] iOS: The app fails to install on iOS device after a second iOS device is also plugged in
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-09-08T18:07:39.000+0000 |
Affected Version/s | Release 3.4.0 |
Fix Version/s | Release 3.4.0, Release 3.5.0 |
Components | CLI, iOS |
Labels | look1, merge-5.0.x, qe-3.4.0, regression |
Reporter | Satyam Sekhri |
Assignee | Chris Barber |
Created | 2014-09-02T10:23:09.000+0000 |
Updated | 2018-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.
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)
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
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.
[~ssekhri] (and others) if you get this to fail, please attach the full TRACE-level log output.
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
[~skypanther] to code review. [~wluu] to FR.
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!
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.
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)
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
[~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.
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.
[~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.
[~cbarber] can you please describe the usage of node-ios-device? Thanks.
I am getting "com.apple.syslog_relay" service (0xe800007f) with 3.4.0.GA and CLI 3.4.0 too
[~mokesmokes] To manually run node-ios-device, edit the following file:
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 thetest-installApp.js
script:That should kick start the app being installed directly to the device. You should be able to retry the install quickly.
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]pl.ironin.storemanager
) to signpl.ironin.favvebooks
. After setting correct profile the app installed flawlessly :)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.
@Luis F. Garcia - Yep that worked for me :) Thanks.
[~ 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.....
Still get this with 3.4.1.GA
[~fokke] is there any difference between what you do and the test case?
[~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.
[~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.
Well, yes.. but with many test devices linked up my MBP's 2 USB ports are not going to be enough ;)
[~cbarber] just had this on an iPad directly connected to my MBP as well :(
Getting this on MBP w/ iPhone 6+ connected via USB. Using Ti SDK 3.5.0.GA
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?
.. this happens on brand new Titanium Mobile App projects too, as well as existing ones.
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.
still happening over here. It was working like 5 minutes ago and now it's broken.
Also found again by this Q&A user: https://community.appcelerator.com/topic/202/failed-to-start-com-apple-syslog_relay-service
Also happening to me intermittently but frequently...
Also happening to me. Any update?
This also happens on Ti SDK 4.0.0 RC1, RC2, RC3 and RC4 intermittently.
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.
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
5.0 has a complete rewrite of the iOS build/libs and should improve this a lot.
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?
[~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.
@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.
PR for improved error message: https://github.com/appcelerator/titanium_mobile/pull/7129
PR on 5: https://github.com/appcelerator/titanium_mobile/pull/7143
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.
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
[~otto.pic] this should be fixed in TiSDK 5.3.0.
Are you sure? I'm using it. Studio 4.6.0.201605201934 and SDK 5.3.0
[~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.
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 ?
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.
[~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.
@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...
[~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, editnode_modules/ioslib/package.json
. Change thenode-ios-device
version from0.8.3
to0.9.5
. Next delete thenode_modules
directory in theioslib
directory. Finally, navigate to theioslib
directory from the Terminal and runnpm install
. You should be good to go.[~perdona] What version of Node.js? OS X I presume? How can I reproduce?
Yes, OSX. Node v5.11.1 Did all of the above, then when I run:
I get
[~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.
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.
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
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 ;)[~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.
Hi [~cbarber] It actually worked now... I re-opened Appcelerator... not sure if it was luck :p
Is it fixed on 5.4.0.GA?
[~perdona] No, unfortunately the fix missed the 5.4.0.GA train. It will be in 5.5.0.GA.
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..
[~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/.
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.