Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用performTaskWithPathArguments执行shell命令?_Javascript_Ios7_Xcode5_Instruments_Ios Ui Automation - Fatal编程技术网

Javascript 如何使用performTaskWithPathArguments执行shell命令?

Javascript 如何使用performTaskWithPathArguments执行shell命令?,javascript,ios7,xcode5,instruments,ios-ui-automation,Javascript,Ios7,Xcode5,Instruments,Ios Ui Automation,为什么下面的命令不起作用 UIATarget.localTarget().host().performTaskWithPathArguments("ANY TEXT", [">>", "ABSOLUT PATH"], 15); 这将返回exitCode 0,stdout看起来很好:任意文本>>绝对路径。 如果将输出复制到终端,则工作正常 我有一个解决方案,我把脚本称为 UIATarget.localTarget().host().performTaskWithPathArgumen

为什么下面的命令不起作用

UIATarget.localTarget().host().performTaskWithPathArguments("ANY TEXT", [">>", "ABSOLUT PATH"], 15);
这将返回exitCode 0,stdout看起来很好:
任意文本>>绝对路径
。 如果将输出复制到终端,则工作正常

我有一个解决方案,我把脚本称为

UIATarget.localTarget().host().performTaskWithPathArguments("PATH TO SCRIPT", ["ANY TEXT"], 15);
脚本中有简单的代码:

echo $1 >> "ABSOLUT PATH"
但是现在我只需要运行一个命令,因为我不能使用任何脚本文件

有没有办法做到这一点

UIATarget.localTarget().host().performTaskWithPathArgumentsTimeout(
"/bin/bash",
["-c", "/bin/echo ANY TEXT >> 'ABSOLUT PATH'"],
15);