I'm working on an Ant build automating start/boot of a tvOS simulator, installs app in the running simulator and launch.
When I execute install-to-simulator command, many a time it appears that the simulator is not fully started yet, hence thrown an error like:
[exec] Unable to lookup in current state: Shutdown
I added a delay of 10 seconds between the start-simulator and install-to-simulator commands, but that solution isn't sufficient either.
How I can determine the state of a particular simulator? Or, how to ensure that the simulator is properly started and not in 'Shutdown' state anymore?
Initially I tried to find a solution with following command:
Unfortunately, I couldn't able to find much of an answer to my needs from the available options.
Thus, I chose to resort on following command:
This returns me a string output in following way:
Therefore a string-check for "(Booted)" or "(Shutdown)" from the output value, does the job for me.