Open ghost opened 8 years ago
Thanks for this detailed write-up! This all makes sense and I think installing the latest runtime version is the best option here.
As far as running xcrun simctl list runtimes
goes, we could be using the DEVELOPER_DIR
environment variable to switch between the installed Xcode versions.
Issue: When multiple versions of the same simulator runtime are available (e.g. for different Xcode versions),
xcversion
picks an arbitrary version for download.For example, for the iOS 8.1 runtime, there are at least two versions available:
In my testing, the command
xcversion simulators --install='iOS 8.1'
is always installing the Xcode 6.4 version. (I think that this order is determined by the order in whichmdfind
returns the installed Xcode app bundles, which I believe is undefined.) The problem is that I don't think that the runtime versions are forwards-compatible, since when I doxcrun simctl list runtimes
after installing this runtime, with Xcode 7.3 as my selected Xcode, I get output like this:Thoughts: It appears that the runtime versions are backwards-compatible; that is, for example, if I install the iOS 8.1 simulator using Xcode 7.3, then it will also work with Xcode 6.4. This suggests a couple of possible solutions:
--xcode-version
argument forxcversion simulators --install
, which allows you to specify "the simulator that is installed must be compatible with this version of Xcode".There will also be an impact on the output of
xcversion simulators
, which should not show a simulator as installed for a given Xcode if the installed simulator runtime version is not compatible with that version of Xcode. (I am not sure how one would go about detecting this without switching Xcode versions and looking at the output ofxcrun simctl list runtimes
, but I haven't investigated it in depth.)It would also have to be decided what the behaviour should be if
xcversion simulators --install
is called when the simulator runtime is already installed, but a newer version is required. I would suggest that it should trigger an upgrade to the newer simulator version.Please let me know if you have any thoughts or questions!