Running UIAutomation tests from Command Line

Posted in Apple, iOS, QA, Testing by AltF on February 5, 2012

Continuous Integration (CI) implements continuous processes of applying quality assurance. In the App development world, we can achieve this by automating the build and release with includes automatic trigger of smoke/functional tests and automatic deployment.

I’ve covered how to write UIAutomation tests in my previous posts (here and here) and also how to distribute stable build over the air (here). You can run your tests from command line and configure a hudson job to always deploy stable build automagically. You can run your tests from CLI using the following command.

$ instruments -t templateFilePath targetAppName

By default the tests will be executed on the simulator, you could execute the tests on actual device using the following command:

$ instruments -w deviceID -t templateFilePath targetAppName

You could execute any instruments template using command line, for example to trigger a UIAutomation template from command line you would use the command as follows:

$ instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <path-to-your-app>/<appname>.app/ -e UIASCRIPT <path-to-your-js-test-file> -e UIARESULTSPATH <path-to-results-folder>

This is really helpful in terms of achieving CI compliance, I’ve basically written a py script that does the following:

– create a new tag from svn trunk with minor release version update
– grab the tag from svn
– complile the app from command line for xocde
– run the uiautomation smoke tests from command line (mentioned above)
– if tests are green, publish the build on the web server for OTA test distribution.
– repeat for new release


Error 3002 when upgrading to iOS 5 beta

Posted in Apple, iOS by AltF on June 8, 2011

Note: You will need to have an iOS developer account to provision your development device.

1. Make sure you have the iTunes 10.5 Beta installed – This is a pre-release version of iTunes 10.5 beta to activate iOS 5 beta on your development devices.

2. Download the correct iOS 5 Beta firmware for your device from

3. In iTunes hold *option* key on the keyboard and press *restore* (Note: option+upgrade will give you Error 3002) and locate the firmware that you downloaded for the device. If you still get Error 3002, make sure that you don’t have any entry for in your /etc/hosts file.

Refer for detailed steps.

Tagged with: , , , , , , , ,
%d bloggers like this: