[TIMOB-12740] iOS: iTunes script intermittently fails to initiate sync
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-17T17:54:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 19, 2013 Sprint 19 API, Release 3.1.3, Release 3.2.0 |
Components | Tooling |
Labels | qe-3.1.3, qe-sdk3.0.2, tooling |
Reporter | Olga Romero |
Assignee | Matt Langston |
Created | 2013-02-14T21:23:39.000+0000 |
Updated | 2013-11-25T20:55:26.000+0000 |
Description
Description:
Having 2 devices plugged in and trying to install app on device intermittently fails to initiate iTunes. However it does auto sync app on one of devices.
Disconnecting one of the devices and trying to install app on it works fine.
Actual result in 3.0.0.GA
[WARN] : An error occurred running the iOS Package Application tool
(it does initiate iTunes and sync works fine, this message appears every time)
Actual result in 3.0.2:
[INFO] : Installing application into iTunes
[INFO] : Initiating iTunes sync
[ERROR] : Failed to initiate iTunes sync
[ERROR] : /Users/oromero/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.v20130207164659/iphone/itunes_sync.scpt: execution error: Can’t make name of *4* into type Unicode text. (-1700)
[ERROR] :
[ERROR] : Project failed to build after 20s 423ms
Tested with:
Titanium Studio, build: 3.0.2.201302141201
Titanium SDK, build: 3.0.2.v20130207164659
iTunes 11.0.1
One device and One cord plugged in to Mac 10.8.2 Mountain Lion
Actual result:
[INFO] : Initiating iTunes sync
[ERROR] : Failed to initiate iTunes sync
[ERROR] : /Users/oromero/Library/Application Support/Titanium/mobilesdk/osx/3.0.2.v20130207164659/iphone/itunes_sync.scpt: execution error: Can’t make name of *3* into type Unicode text. (-1700)
[ERROR] :
[ERROR] : Project failed to build after 17s 73ms
I noticed iTunes sync usually fails after importing projects.
Occurs with 3.1.2 Studio and SDK 3.1.2.GA
Try this:
Part of the problem was the existing line:
It should be "name of source n". Fixing this generates another error, which looks like this for our device "aquaman":
Changing the lines:
to this:
Sorts out that problem.
Another sample:
After some additional testing the 2 sample scripts above will fail with an error when Itunes is already syncing. I have not accounted for this. The error returned is -1708.
PR: https://github.com/appcelerator/titanium_mobile/pull/4629
Backport PR: https://github.com/appcelerator/titanium_mobile/pull/4630
This was the proper fix for itunes_sync.scpt, which I paste below since the actual file that is checked into the repo is a binary file AppleScript file.
This _is_ merged to 3.1.3, but still _remains to be merged_ for 3.2.0 (master)
To test the fix: 1) Connect 3 iOS devices 2) Build with 3.1.2.GA to see fail case. (this ticket) 3) Build with 3.1.3.v2013090714460 or later - pass if no error presented on sync step 4) If using iTunes 11, set app to install and sync all devices 5) Make a change to project in studio - re-build for device 6) After sync, ensure all devices see the update you made 7) Additional test - try to time a manual sync via iTunes to occur when the build sync starts (potential error generation) 8) Additional test - launch the script via applescript editor, set bottom tab to "events" and run script. Ad-hoc test
I Executed above 1-7 steps successfully with no intermittent fail or crash. But could not execute the 8th step.
8th Step verified. Closing as fixed.
Note that this has still not been merged to master.
As Ingo stated, this still occurs on: Titanium Studio, build: 3.2.0.201310181940 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131018154951 Ti CLI: 3.2.0 (72f7426b4ee6c2d2883c666d5b7e03906a16012f)
[~emerriman], can you try again testing and merging this with master/3.2.0 please? You couldn't do this before because master was broken, but I don't think this is still the case.
[~mlangston], I still see this issue on the latest master/3.2.0 Tested on: Titanium Studio, build: 3.2.0.201310230548 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131023140842 Ti CLI: 3.2.0 (72f7426b4ee6c2d2883c666d5b7e03906a16012f)
It's not merged. It still has a merge-3.2.0 label on it.
Was able to still reproduce the issue on: Titanium Studio, build: 3.2.0.201311211626 SDK build: 3.2.0.v20131121163252 CLI: 3.2.0-alpha Alloy: 1.3.0 (it://github.com/appcelerator/alloy.git#1_3_X) Xcode: 5.0.2 Device: ipad 2 (7.0.2), iphone 5 (6.1.3), iphone 5 (7.0.2) Note: If using 3.2.0 SDK, you will get a different error message, but the bug is still the same: [TRACE] : ** BUILD SUCCEEDED ** [INFO] : Installing application into iTunes [INFO] : Initiating iTunes sync [ERROR] : Project failed to build after 15s 565ms And the ~/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/iphone/itunes_sync.scpt will fix this issue.
Closing ticket as fixed. Verified iTunes script does not intermittently fail to initiate sync. Also, verified the same script from ~/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/iphone/itunes_sync.scpt is in the 3.2.0 SDK. Tested on: Titanium Studio, build: 3.2.0.201311221859 SDK build: 3.2.0.v20131122172908 CLI: 3.2.0-alpha Alloy: 1.3.0-alpha6 Xcode: 5.0.2 Device: ipad 3 (7.0.2), iphone 5 (6.1.3), iphone 5 (7.0.2)