[TIMOB-24837] ioslib: Unable to autoselect iOS 10.3.1 sim with Xcode 8.3.3
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-06-23T00:36:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.1, ioslib 1.4.8 |
Components | Tooling |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2017-06-15T23:19:16.000+0000 |
Updated | 2017-06-24T00:30:51.000+0000 |
Description
Xcode 8.3.3 introduced iOS SDK 10.3.1 which causes some troubles for ioslib. ioslib ties the simulator to the iOS SDK tied to the simulator runtime in the runtime's plist file, which is "10.3" even for "10.3.1". ioslib cheats and skips this and just associates the sim with the iOS SDK installed with Xcode.
Since Xcode 8.3.3 comes with iOS 10.3.1, ioslib will naively define an iOS 10.3.1 simulator.
When autoselecting a simulator, it scans the Xcode iOS Simulators, namely 10.3.1, and tries to load the simulator details, which are associated to the iOS SDK tied to the sim runtime. In this case, the 8.3 sim runtime is tied to iOS SDK 8.3 as defined in the sim runtime's plist.
When ioslib tries to lookup a 10.3.1 simulator, it won't find any matches and hence the error:
[TRACE] [ioslib] No iOS Simulator UDID specified, searching for best match
[TRACE] [ioslib] Scanning Xcodes: 8.3.3:8E3004b
[ERROR] Unable to find any Xcode installations that supports at least iOS 10.
The solution is to create a distinct list of iOS SDKs associated to each sim runtime based on both the sim runtime's plist and the output from simctl
. While the plist will return "10.3", simctl
will return "10.3.1". We can then loop over each version and define the same simulator for both iOS SDKs. Redundant? Yes. Does it work? Yes.
On a side note, there's a small bug where the correct simulator is being selected, but the wrong Xcode version. It is supposed to pick the most recent Xcode that supports the selected Xcode. However there's a bug where we A) don't filter unsupported Xcodes and B) we don't break the loop after the first recent match resulting in the oldest Xcode being selected.
ioslib PR: https://github.com/appcelerator/ioslib/pull/63
TiSDK master PR: https://github.com/appcelerator/titanium_mobile/pull/9153 To test, install Xcode 8.3.2 and 8.3.3. You will have iOS SDK 10.3 and 10.3.1 respectively. Run
ti info -t ios
to verify. You should notice both 10.3 and 10.3.1 simulators. Note that the UDIDs are duplicated between 10.3 and 10.3.1 since from Xcode's perspective they (the sim runtimes) are identical. You should enable autoselecting (default)ti config ios.autoSelectDevice true
. Then build an app for the simulator:ti build -p ios -I 10.3
andti build -p ios -I 10.3.1
. Observe the trace log output at the very beginning to make sure it picks the correct Xcode version.FR Passed. The correct Xcode/simulators are selected when using Xcode 8.2, 8.3.2, 8.3.3, and 9.0b. Tested by having Xcode(s) installed and building for sim, device, adhoc, and appstore, then verifying that the correct Xcode and/or simulator version was selected for the build, as well as ensuring the app would install/launch/verify.
6_1_X backport: https://github.com/appcelerator/titanium_mobile/pull/9174
I tested the back port version with this environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.2 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.1.v20170623141152 Appcelerator Studio, build: 4.9.0.201705302345 Xcode 8.3.3 I tested with the above SDK version and verified that building to Sim and device worked as expected. I also checked that Ad Hoc builds and AppStore builds also continue to work.