So far I've successfully run iOS automation from the Instruments GUI and also using instruments on the command line. I haven't found any options that would allow me to manually open or close my app as part of the test. Instead it seems that running instruments will always launch the app at the beginning and close it at the end.
The reason I would like my app to stay open is because part of my test involves a pairing process with the desktop browser. Ideally in jenkins on osx I'd have a sequence of shell commands:
- run instruments test that puts app into "display passcode" state.
- run another command that enters the passcode in my browser component.
- run another instruments test that verifies my app has successfully paired.
If my app automatically closes after step 1 then the rest of the sequence won't work.
Alternatively I've checked if there's a way to execute the shell commands from within the instrumented test, but it seems that js doesnt allow such things because it would be a security risk. I'm happy with osx specific commands since I don't intend to run this on windows.