Is there a way to open the UIAutomation
instrument through the terminal?
Will it be possible to write an AppleScript
to open Apple's UIAutomation
tool and load the application to be tested?
Can you please tell me is there any way through scripting or through the command line we can open UIAutomation
and select the app to be tested, as well as select the test script?
instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/\
PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
for xcode >= 4.5
instruments -t
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
for xcode >= 6.1
instruments -w <device ID> -t \
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
There a few important things to note though:
full_path_to_application is the path to your .app file that is created by your simulator. For me, the path was
/Users/fwasim/Library/Application Support/iPhone Simulator/5.0/Applications/AA6BA2E1-D505-4864-BECC-29ADEE28194D/name_of_application.app
this path might be different for anyone else depending on what iOS version are you running on your simulator. Also remember to put this path in double quotation marks.
The path_to_script.js should be the FULL PATH to where your automation script written in javascript is saved. Also remember to put this path in double quotation marks.
Lastly output results path is the path where you want to save the output results. Also remember to put this path in double quotation marks.
These were the points I had been missing on and thus was getting some of the errors mentioned above.