参考文档:
http://www.cnblogs.com/silmerusse/archive/2013/07/18/3198590.html
1. 通过调用UIAutomation去执行 python -V(注意是大写的V)查看python当前版本
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/usr/bin/python", ["-V"], 5);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
stdout 应该显示python的版本号
主要是performTaskWithPathArgumentsTimeout函数怎么用的,一共三个参数,
第一个参数是:执行命令的路径并加上命令名
第二个参数是:命令所带的参数
第三个参数是:执行命令超时时间。单位为秒