One can have multiple simulator runtimes installed, supporting
various generations of OSs. The logic in TestAppleSimulatorOSType
might select a rnutime older than the one targeted by the current
tools, preventing the executable from running. This commit changes
the test to look for the most recent runtime available instead.
sim_devices = json.loads(sim_devices_str)['devices']
# Find an available simulator for the requested platform
deviceUDID = None
+ deviceRuntime = None
for simulator in sim_devices:
if isinstance(simulator,dict):
runtime = simulator['name']
continue
if 'isAvailable' in device and device['isAvailable'] != True:
continue
+ if deviceRuntime and runtime < deviceRuntime:
+ continue
deviceUDID = device['udid']
- break
- if deviceUDID != None:
+ deviceRuntime = runtime
+ # Stop searching in this runtime
break
# Launch the process using simctl