When I run the simctl launch
command to launch an app in iOS Simulator, the app may or may not come up, depending on how long it takes for the iOS Simulator to get its act together. The following observations lead me to believe that there is some sort of a timeout involved, but it's not apparent from the limited simctl
documentation what that timeout is and how to control it.
When launching the app, it may not launch (iOS Simulator comes to the home screen) if the app is not up in anywhere from 35-90 seconds. However, if the app manages to launch in under 20 seconds, it always comes up.
If first launch fails, same app, same machine, same command will usually succeed on 2nd or 3rd attempt as whatever needs to 'warm up' does so.
I am guessing the timeout is probably 30 seconds. How can I set it to a larger value?
Update:
Here's our exact sequence of events:
- If device is shut down, boot it (
simctl boot ...
) and wait for status to change to Booted insimctl list
- Uninstall app (
simctl uninstall ...
) - Install app (
simctl install ...
) - Shut down the device (
simctl shutdown ...
) and wait till it has shut down - Start iOS Simulator (
open -a "<path to simulator> --args -CurrentDeviceUDID <device id>
) - Wait for device to reach status Booted
- Launch app (
simctl launch ...
)
It is this last step that doesn't always succeed. There is no error, the app just doesn't come up.