Archive for February 2011
I started writing this shell script because Xcode 4 keeps crashing, so I ended up editing my code in TextMate, and had iTerm open so I can build, then deploy the app automatically in iPhone Simulator.
The script takes three arguments, the first is the name of the project (here the limitation is that it has to be the name of the .xcodeproj and the .app name), and the second is the configuration (Debug/Release – defaults to Debug), and the third is an optional argument, the name of the log file that the log will be written to (defaults to stderror.log).
Also, you will need the latest code of ios-sim. I could have added a step to check whether you have it installed and download, build and install it for you, but maybe next time 😉 Make sure you download the latest source, and not one of the packages.
One you download it and build it, copy the ios-sim binary to somewhere in your path – /usr/bin is a good location.
Download the script. It is WTFPL licensed. Run it without arguments to see the help text.
chmod 755 sim-run.sh on the script to give it exec privileges.
The script builds your project, launches the project in the iPhone Simulator, activates the iPhone Simulator (brings it to front), logs the output to a file, and also displays the contents of the logfile as it is written to. On each run, it writes to a fresh log file, and the previous log file is backed up.