Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23636] Failed watchOS pairing will silently fail appc run without error

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2016-07-29T14:05:17.000+0000
Affected Version/sioslib 0.12.0
Fix Version/sioslib 0.12.0, ioslib 0.13.0, Release 5.5.0
ComponentsiOS, Tooling
Labelsn/a
ReporterJan Vennemann
AssigneeChris Barber
Created2016-07-13T22:00:48.000+0000
Updated2018-08-06T17:49:31.000+0000

Description

Changing watch pairings within Xcode result in orphaned watchOS simulators which are still being reported as available by ioslib. When trying to build an app and run it on the simulator, appc run just silently fails, without reporting any error.

Steps to reproduce

1. *appc new --classic* 2. Enter project root 3. *appc new -t applewatch* 4. Open Xcode and change the watch pairing for an iOS device under Window > Devices (e.g. remove the existing watch and add a new one) 5. *appc run -p ios -I 10.0 --launch-watch-app -l trace*

Expected result

App launches successfully with both iOS and watch simulators

Actual result

appc run exits without any error and no simulators are being launched
~/Development/appc/pairing-test ❱❱❱ appc run -p ios -I 10.0 --launch-watch-app -l trace
...
[INFO]  Finished building the application in 1m 3s 751ms
[INFO]  Launching iOS Simulator
[TRACE] [ioslib] Found watchOS 3.0 app: com.appcelerator.pairing-test.watchkitapp
[TRACE] [ioslib] Selected iOS Simulator: iPhone SE
[TRACE] [ioslib]   UDID    = AD4CB766-B439-4E20-B441-8EA281CC3658
[TRACE] [ioslib]   iOS     = 10.0
[TRACE] [ioslib] Selected WatchOS Simulator: Apple Watch - 42mm
[TRACE] [ioslib]   UDID    = B3649832-4484-4A43-8468-BC7D8931F4D0
[TRACE] [ioslib]   WatchOS = 3.0
[TRACE] [ioslib] Autoselected Xcode: 8.0
[TRACE] [ioslib] Removing old log file: /Users/jvennemann/Library/Developer/CoreSimulator/Devices/AD4CB766-B439-4E20-B441-8EA281CC3658/data/Containers/Data/Application/539F97C1-5E55-410E-A070-0AA2F1BC7913/Documents/bc3ea531-50b4-4fa1-9555-691fdc9b8133.log
[TRACE] [ioslib] Unpairing iOS and watchOS simulator pair: B8AAE696-D6C8-43E8-AD2E-C9F703406C49
[TRACE] [ioslib] Running: /Applications/Xcode-beta.app/Contents/Developer/usr/bin/simctl unpair B8AAE696-D6C8-43E8-AD2E-C9F703406C49
[TRACE] [ioslib] Pairing iOS and watchOS simulator pair: B3649832-4484-4A43-8468-BC7D8931F4D0 -> AD4CB766-B439-4E20-B441-8EA281CC3658
[TRACE] [ioslib] Running: /Applications/Xcode-beta.app/Contents/Developer/usr/bin/simctl pair B3649832-4484-4A43-8468-BC7D8931F4D0 AD4CB766-B439-4E20-B441-8EA281CC3658

~/Development/appc/pairing-test ❱❱❱

Attachments

FileDateSize
appc-info.txt2016-07-13T21:50:11.000+00007837
simctl-list.txt2016-07-13T21:50:05.000+00005096

Comments

  1. Chris Barber 2016-07-28

    PR: https://github.com/appcelerator/ioslib/pull/38
  2. Jan Vennemann 2016-07-29

    Looks good, it now won't quit silently anymore. It still initially selects a non existing watchOS sim, though. I found out that calling simctl delete will not remove the sim directory for watchOS sims, BUT indeed will do so for iOS sims. I know you said the simctl tool is hardly worked on, but nevertheless i filed a bug report with Apple. Let's see what happens there :)
  3. Harry Bryant 2016-08-18

    Unable to validate this ticket until TIMOB-23614 is resolved.
  4. Harry Bryant 2016-08-24

    Followed the test steps and encountered the following on build:
       [TRACE] ** BUILD SUCCEEDED **
       [INFO]  Finished building the application in 1m 16s 764ms
       [INFO]  Launching iOS Simulator
       [TRACE] [ioslib] Found watchOS 3.0 app: com.appc.watchTestv3.watchkitapp
       [TRACE] [ioslib] Selected iOS Simulator: iPhone SE
       [TRACE] [ioslib]   UDID    = AAB1D702-339D-4E12-970D-CC983D7B4AFC
       [TRACE] [ioslib]   iOS     = 10.0
       [TRACE] [ioslib] Selected WatchOS Simulator: Apple Watch - 42mm
       [TRACE] [ioslib]   UDID    = 2CD3C9CD-3780-4221-A24A-71F9C2FF2AD3
       [TRACE] [ioslib]   WatchOS = 3.0
       [TRACE] [ioslib] Autoselected Xcode: 8.0
       [TRACE] [ioslib] Removing old log file: /Users/harrybryant/Library/Developer/CoreSimulator/Devices/AAB1D702-339D-4E12-970D-CC983D7B4AFC/data/Containers/Data/Application/14F0A05A-C691-4CDE-9468-1C9B7C52BAF3/Documents/8cee0a82-6c67-4dbb-9666-27d3eff34c1e.log
       [TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl list pairs --json
       [TRACE] [ioslib] Unpairing iOS and watchOS simulator pair: 4B8043CF-E1BD-434B-9D07-FA6749C797D1
       [TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl unpair 4B8043CF-E1BD-434B-9D07-FA6749C797D1
       [TRACE] [ioslib] Pairing iOS and watchOS simulator pair: 2CD3C9CD-3780-4221-A24A-71F9C2FF2AD3 -> AAB1D702-339D-4E12-970D-CC983D7B4AFC
       [TRACE] [ioslib] Running: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl pair 2CD3C9CD-3780-4221-A24A-71F9C2FF2AD3 AAB1D702-339D-4E12-970D-CC983D7B4AFC
       [ERROR] Invalid device: 2CD3C9CD-3780-4221-A24A-71F9C2FF2AD3
       
    The question is whether this is an expected result when you delete an existing watch pairing and create a new one, or should it build successfully? Tested On: iPhone 6S (10.0) Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 5.5.0.v20160822000355 Appc Studio: 4.7.1.201608190732 Appc NPM: 4.2.7 App CLI: 5.5.0-5 Version 8.0 beta 6 (8S201h) Node v4.4.7
  5. Chris Barber 2016-08-24

    Hmm, this doesn't sound right. It says it found the Watch sim 2CD3C9CD-3780-4221-A24A-71F9C2FF2AD3, but then the pair failed? The output shows the unpair and pair commands. You should manually unpair and re-pair to see if you can reproduce the problem outside of Titanium.
  6. Jan Vennemann 2016-08-24

    If i remember correctly this was because of the way ioslib initially detects all available simulators. It manually scans ~/Library/Developer/CoreSimulator/Devices for device folders. When you delete a watch sim with Xcode or simctl the corresponding device folder will not get deleted and ioslib still detects the simulator. Running appc info vs xcrun simctl list should show the differences.
  7. Chris Barber 2016-08-24

    Yeah, that's a good point. I created TIMOB-23821 to switch to simctl.
  8. Eric Merriman 2018-08-06

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

JSON Source