Multiple Simulator Projects

I compare the launch of several projects using the Xcode simulator. Every time I am going to build one project after starting one of the other projects, Xcode tells me that it cannot complete the build and run because the simulator is being used. Then I need to find another project window, stop the launch in the simulator (Cmd-.), And then return to the previous window and rebuild. Can I make one key combination to stop the current run in the simulator, build and run the current project in the simulator?

+1
xcode xcode4 ios-simulator
Mar 04 '12 at 3:11
source share
2 answers

There is little to do this, but overall it's pretty easy.

The first thing you need to do is open Automator. If you have never used it before, it is included on your Mac, so just do a search. When Automator starts up, you will be asked to create a new project, select "Service". enter image description here

Then adjust the reception section as follows enter image description here

On the left side of Automator, you’ll see a search bar, find “Launch Applescript”, and then drag the instance “Launch Applescript” into the “Service” section. enter image description here Now you will want to change the application to suit your needs. In this case, you replace "(* Your script goes here *)" with "tell the iPhone Simulator application to exit"

enter image description here As soon as you finish modifying Applescript, save the automation as you like, it will appear in the services under this name.

Now you’ll go to “System Preferences” and search for “services”, enter image description here As you can see, I called my service “Quit Simulator” to select yours and define any shortcut that you want for it. (Try not to conflict with existing shortcuts!)

And now, if you encounter a "Simulator in use" error, you can exit the simulator by ending any current process with a simple keystroke.

Hope this helps!

+5
Mar 04 '12 at 7:00
source share

Each launch depends on their project window (as far as I know). Therefore, you will need to go to the project window and stop the build, or just exit Simulator (cmd + q) and create a new project again.

+2
Mar 04
source share



All Articles