Instruments command-line cannot pass parameters to the instrument.

Originator:cgruber
Number:rdar://9150033 Date Originated:2011-03-17
Status:Open Resolved:
Product:Developer Tools Product Version:4
Classification:Enhancement Reproducible:Yes
 
Summary:

Instruments provides an Automation instrument, which allows the developer to script UI actions using Javascript.  The command-line version of instruments allows the selection of the target app, of the instruments template, and the instrument itself, but has no way to pass the Javascript file containing the test actions itself to the underlying instrument.  So you can start up instruments, which starts up the app, with the right Automation instrument, does so in the context of the template, but has no way to receive instructions. 

In the UI version, you would select the .js file explicitly in the properties of the instrument.  There's no equivalent in the command-line.

This puts the instruments system just one step short of being a fully suitable test automation harness.  Currently, it is unsuitable to be used in an automated continuous build and testing environment.

Steps to Reproduce:

use instruments from the command-line with any iOS app, any template, and the automation instrument, with any timeout. 

Expected Results:

N/A - can't specify conditions for the expected result, which is that instruments launches the app and executes the test script.

Actual Results:

Instruments launches the app, and sits there, until the timeout is reached, then the app is closed (but not the simulator)

Regression:

N/A

Notes:

The above would allow for scripting from bash or other sources, cronjobs, whatever.  Another approach would be to add applescript hooks to the Instruments app itself, so it could be scripted via applescripts.

Comments

You can do this with -e UIASCRIPT /path/to/my/script.js


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!