Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to close the iOS Simulator from the command line?

Is there any way to quit the iOS Simulator via a command line script?

Background:

I am setting up a Continous Integration environment to enable iOS builds to compile and be tested automatically. As part of this I am running scripts using Apple's UI Automation tool within Instruments.

I've managed to automate the execution of the scripts on the iOS Simulator by running Instruments from the command line BUT now I now want to automate quitting of the Simulator.

I have tried some Apple Script similar to this post: How can I reset the iOS Simulator from the command line? but get the error "Access for assistive devices is disabled". Hopefully, there is a simpler way?

like image 752
MandyW Avatar asked Nov 09 '11 11:11

MandyW


2 Answers

For Xcode 7+ the command is killall Simulator.

like image 151
Danyal Aytekin Avatar answered Oct 04 '22 23:10

Danyal Aytekin


killall "iOS Simulator" in the Terminal will close it.

Also, you can launch it with iphonesim to have more control over it, including modifying the source to your needs.

like image 44
djromero Avatar answered Oct 05 '22 01:10

djromero