Closed danielribeiro closed 7 years ago
It seems it failed to find the 9.2 runtime and falls back to using the default one from Xcode.
It attempts to find it here: /Library/Developer/CoreSimulator/Profiles/Runtimes/
$ ls -la /Library/Developer/CoreSimulator/Profiles/Runtimes/
total 0
drwxr-xr-x 16 root wheel 544 Dec 18 08:11 .
drwxr-xr-x 3 root wheel 102 Feb 4 2016 ..
drwxrwxr-t 3 root admin 102 Dec 18 08:09 iOS 10.0.simruntime
drwxrwxr-t 3 root admin 102 Dec 13 09:09 iOS 10.1.simruntime
drwxrwxr-t 3 root admin 102 Feb 6 2016 iOS 8.1.simruntime
drwxrwxr-t 3 root admin 102 Feb 6 2016 iOS 8.2.simruntime
drwxrwxr-t 3 root admin 102 Feb 6 2016 iOS 8.3.simruntime
drwxrwxr-t 3 root admin 102 Feb 5 2016 iOS 8.4.simruntime
drwxrwxr-t 3 root admin 102 Feb 4 2016 iOS 9.0.simruntime
drwxrwxr-t 3 root admin 102 Feb 5 2016 iOS 9.1.simruntime
drwxrwxr-t 3 root admin 102 Mar 23 2016 iOS 9.2.simruntime
drwxrwxr-t 3 root admin 102 Jun 15 2016 iOS 9.3.simruntime
drwxrwxr-t 3 root admin 102 Feb 6 2016 tvOS 9.0.simruntime
drwxrwxr-t 3 root admin 102 Mar 24 2016 tvOS 9.1.simruntime
drwxrwxr-t 3 root admin 102 Feb 7 2016 watchOS 2.0.simruntime
drwxrwxr-t 3 root admin 102 Mar 24 2016 watchOS 2.1.simruntime
The code in question is here: https://github.com/plu/simctl/blob/master/lib/simctl/device_path.rb#L36-L41
def locate_runtime_root
"/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path|
return path if File.exists?(path)
end
Xcode::Path.sdk_root
end
I've tried the same setup, iOS 9.x device, Xcode 8.0, El Capitan, using the same script and it works...
~/Development/simctl[master*]$ ruby -Ilib test.rb
xcrun simctl list -j devices
xcrun simctl boot A179B896-6B35-489D-9A2B-E19334CF01D5
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
xcrun simctl list -j runtimes
xcrun simctl spawn A179B896-6B35-489D-9A2B-E19334CF01D5 /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 9.0.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl list
xcrun simctl list -j devices
~/Development/simctl[master*]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.rb
nothing added to commit but untracked files present (use "git add" to track)
#!/usr/bin/env ruby
require 'simctl'
ENV['SIMCTL_DEBUG']="true"
device_id="A179B896-6B35-489D-9A2B-E19334CF01D5"
timeout = 240
device = SimCtl.device(udid: device_id)
device.boot
device.wait(timeout) { |d| d.state == :booted && d.ready? }
~/Development/simctl[master*]$ xcodebuild -version
Xcode 8.0
Build version 8A218a
Thanks @plu ! It seems my simulator runtimes are in a non standard location.
We can make this customizable in device_path.rb
, if you want?
It sounds useful, but I'm just moving the simulators to a standard location.
I believe there was a bug on Xcode 6 where just seeing newer simulators on the coresimulator folder was enough to make it crash. Xcode 7 does not have this problem, so going back to standard locations should suffice.
Hi,
I've been experimenting with
... to get a device up and running. It works on 64bit devices, but fails on 32 bit devices.
The following ruby script on the cosole outputs the details
output
All using xcode 8.0.0, on ElCapitain