ExploringApple
ExploringApple

Reputation: 1484

Not able to write in txt file using performTaskWithPathArgumentsTimeout with python/shell in Instruments

When i try to execute python/shell script(to write in txt file) using performTaskWithPathArgumentsTimeout it doesnt works. I am using it in UIAutomation through Instruments. The result code and error is also '0'. So cant find out exact problem.

Code:

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)    

The out put in result is: exit code: 0 std output : error output:

When I execute same in terminal the text file is getting created and written but not working when executen throgh javascript in Instruments.

Upvotes: 0

Views: 563

Answers (1)

ExploringApple
ExploringApple

Reputation: 1484

The problem is instruments need full path and doesn't work with relative path.

Always use full path while referring files for UIAutomation in instruments.

Upvotes: 2

Related Questions