[TIMOB-23146] iOS/WatchOS: Installing to Simulators hangs since Xcode 7.3
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-12T02:49:20.000+0000 |
Affected Version/s | Release 5.2.1 |
Fix Version/s | Release 5.3.0, ioslib 0.10.4, ioslib 0.10.5 |
Components | iOS, Tooling |
Labels | qe-5.3.0 |
Reporter | Fokke Zandbergen |
Assignee | Chee Kiat Ng |
Created | 2016-04-05T09:16:01.000+0000 |
Updated | 2016-05-25T05:07:38.000+0000 |
Description
[~cng] [~htbryant] and myself can't get the [Titanium 5.2.0 Sample](https://github.com/appcelerator-developer-relations/appc-sample-ti520) to install the WatchOS2 app to the Simulator anymore.
This was also reported on [TiSlack](https://ti-slack.slack.com/archives/general/p1459847345001026) by Erik Storli and he found that downgrading Xcode to 7.2.1 resolved it. So something changed in 7.3 that breaks ioslib.
When you build the [Titanium 5.2.0 Sample](https://github.com/appcelerator-developer-relations/appc-sample-ti520) using
ti build -p ios --launch-watch-app
it will hang at _Waiting for Watch App to install_:
[INFO] Launching iOS Simulator
[TRACE] [ioslib] Found watchOS 2.2 app: com.appcelerator.sample.ti520.watchkitapp
[TRACE] [ioslib] Selected iOS Simulator: iPhone 6s Plus
[TRACE] [ioslib] UDID = C7ECC4A2-E0F1-4248-B51E-5873696E719E
[TRACE] [ioslib] iOS = 9.3
[TRACE] [ioslib] Selected WatchOS Simulator: Apple Watch - 42mm
[TRACE] [ioslib] UDID = 7BCFC934-2DDA-4768-A7CA-929DA315E8A4
[TRACE] [ioslib] WatchOS = 2.2
[TRACE] [ioslib] Autoselected Xcode: 7.3
[TRACE] [ioslib] iOS and watchOS simulators already paired
[TRACE] [ioslib] Tailing iPhone 6s Plus Simulator system log: /Users/fokkezb/Library/Logs/CoreSimulator/C7ECC4A2-E0F1-4248-B51E-5873696E719E/system.log
[TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl shutdown C7ECC4A2-E0F1-4248-B51E-5873696E719E
[TRACE] [ioslib] iPhone 6s Plus Simulator was already shutdown
[TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID C7ECC4A2-E0F1-4248-B51E-5873696E719E
[TRACE] [ioslib] iPhone 6s Plus Simulator started
[TRACE] [ioslib] Tailing Apple Watch - 42mm Simulator system log: /Users/fokkezb/Library/Logs/CoreSimulator/7BCFC934-2DDA-4768-A7CA-929DA315E8A4/system.log
[TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl shutdown 7BCFC934-2DDA-4768-A7CA-929DA315E8A4
[TRACE] [ioslib] Apple Watch - 42mm Simulator was already shutdown
[TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/Applications/Simulator (Watch).app/Contents/MacOS/Simulator (Watch) -CurrentDeviceUDID 7BCFC934-2DDA-4768-A7CA-929DA315E8A4
[TRACE] [ioslib] Apple Watch - 42mm Simulator started
[TRACE] [ioslib] Running: osascript "/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/node_modules/ioslib/lib/sim_focus.scpt" "Simulator (Watch)"
[TRACE] [ioslib] Apple Watch - 42mm Simulator successfully focused
[TRACE] [ioslib] Running: osascript "/Users/fokkezb/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/node_modules/ioslib/lib/sim_focus.scpt" "Simulator"
[TRACE] [ioslib] iPhone 6s Plus Simulator successfully focused
[TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl install C7ECC4A2-E0F1-4248-B51E-5873696E719E /Users/fokkezb/dev/samples/appc-sample-ti520/build/iphone/build/Products/Debug-iphonesimulator/Ti 5.2.0.app
[TRACE] [ioslib] App installed
[TRACE] [ioslib] Waiting for Watch App to install…
I believe the system log has changed between Xcode 7.2.1 and Xcode 7.3 This is where the if statement never gets hit https://github.com/appcelerator/ioslib/blob/master/lib/simulator.js#L961
Here's the simulator system log for Xcode 7.3 just before it got stuck.
For Xcode 7.2.1, the log we are looking for is:
Apr 7 15:24:50 AppcAdmins-MacBook-Pro companionappd[2266]: (Note ) WatchKit: application (com.appcelerator.sg.testwatch2.watchkitapp), install status: 2, message: application install success
which is completely non-existent in Xcode 7.3. In Xcode 7.3, it seems generic so far.Apr 6 14:20:38 AppcAdmins-MacBook-Pro appconduitd[43308]: 0x70000019a000 -[ACXServerInstallOperation receivedDictionaryOrData:]: com.appcelerator.sg.testwatch2: Got install done
PR here: https://github.com/appcelerator/ioslib/pull/31 Not the best fix but, the new system log is just....unbearably terrible compared to Xcode 7.2.1 and earlier. So much so that it's nearly impossible to find valid info in the log that confirms that the watchapp is installed, other than
Installation of com.appcelerator.sg.testwatch2.watchkitapp acknowledged.
Will do TIMOB PR if PR is ok.
Why the like that says the installation is acknowledged? There's a line towards the end that seems even better to test for:
What about if the watchkit app fails to install?
As discussed the day before, "Finished install" can imply both success and failure, so acknowledged is still a better choice. and since we are unable to produce a fail case, this approach is the best way forward. Chris has done the code review and he's ok. [~hansknoechel] can you do an FR? Thanks.
titanium_mobile PRs: Master: https://github.com/appcelerator/titanium_mobile/pull/7936 5_3_X: https://github.com/appcelerator/titanium_mobile/pull/7937
PRs merged.
I receive the following error when trying to build the sample app with
ti build -p ios --launch-watch-app
through the CLI. There are no errors when building through Studio or through the CLI with*appc run* -p ios --launch-watch-app
:Tested On: iPhone 6S (9.3) Simulator & Watch OS2.2 Simulator Mac OSX El Capitan 10.11.3 (15D21) Ti SDK: 5.3.0.v20160517124218 Appc Studio: 4.6.0.201605180604 Appc NPM: 4.2.5-5 App CLI: 5.3.0-45 Xcode 7.3 Node v4.2.6 production
[~htbryant] where's the "following error" which you indicated in your comment? Did you mean the same problem as the ticket?
[~cng] Apologies, I forgot to include the error, I've amended my previous comment.
[~htbryant] Just a hunch, but can you try not to have a spacing in the project name see if that works? also, give *appc ti build -p ios --launch-watch-app* a shot too. Thanks.
[~cng] Running
appc ti build -p ios --launch-watch-app
works absolutely fine. Removed the space in the project name and ranti build -p ios --launch-watch-app
and ran into the same error.Watch OS apps can be built to simulators successfully using
appc run -p ios --launch-watch-app
. Tested on: OS X El Capitan Version 10.11.4 iPhone 6S Simulator and Watch OS 2.2 Simulator Appc Studio: 4.6.0.201605201934 Ti SDK: 5.3.0.v20160517124218 Appc NPM: 4.2.5-5 Appc Core: 5.3.0-46 Node: v4.4.4 *Closing Ticket.*So, we close this ticket as fixed as
appc run
andappc ti build
work, even thoughti build
does not? That troubles me for 2 reasons: * We're ignoring an OSS tooling bug. * We're not investigating *why*appc ti build
andti build
differ, possibly leaving fundamental architecture flaws uncovered.