UIAHost Class Reference
Available in iOS 5.0 and later.
UIAHost class allows your script to exercise limited control over the Automation instrument process running on the host computer.
For an explanation of how to use this and related classes, see “Automating UI Testing” in Instruments User Guide.
Performing a Task on the Host Computer
Executes a task from the Automation instrument process running on the host.
The pathname of the code to run, relative to the root level of the host’s boot drive.
An array that specifies the arguments for the code to be run.
The length, in seconds, of the grace period in which the task is expected to execute, before script execution resumes.
The process executes from within the context of the Instruments application parent process. The code below runs the
echo command to display “Hello World” with a grace period of 5 seconds.
The returned object contains the properties
stderr. The example uses these properties to capture the exit code, standard output stream, and standard error stream, displaying each in a log message with a
debug severity level.
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/usr/bin/echo", ["Hello World"], 5);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
- Available in iOS 5.0 and later.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)