How to get exit code of an app launched with 'xcrun simctl launch' ?

I execute some autotests on ios simulator with the commands:

xcrun simctl install booted myApp
xcrun simctl launch --console booted myApp

That works well and runs the tests as expected. However I would like to get exit code of the execution of myApp, and I don't manage to get it... If myApp terminates abnormally the exit code I get from $? is 0 which makes sense as it is the exit code of xcrun which actually succeeds.
Do you have any ideas ? maybe using xcrun simctl getenv somehow ?

Thanks in advance.

How to get exit code of an app launched with 'xcrun simctl launch' ?
 
 
Q