在Instruments中使用带有python / shell的performTaskWithPathArgumentsTimeout无法在txt文件中写入

时间:2012-08-27 09:58:59

标签: ios-ui-automation xcode-instruments

当我尝试使用performTaskWithPathArgumentsTimeout执行python / shell脚本(在txt文件中写入)时,它不起作用。我通过仪器在UIAutomation中使用它。结果代码和错误也是'0'。所以无法找出确切的问题。

代码:

var result = target.host().performTaskWithPathArgumentsTimeout("/usr/bin/python", ["/Users/swr/Development/onexsipios/Automation/iOSClient/sum.py"], 15);


UIALogger.logMessage("exit code: " + result.exitCode + " std output : " + result.stdout + " error output: " + result.stderr)    

输出的结果是:     退出代码:0标准输出:错误输出:

当我在终端中执行相同的操作时,文本文件被创建和写入,但在执行器件中执行throgh javascript时无效。

1 个答案:

答案 0 :(得分:2)

问题是仪器需要完整路径,并且不适用于相对路径。

在为乐器中的UIAutomation引用文件时,始终使用完整路径。