1

UIASCRIPT:

var result = UIATarget.localTarget().host().performTaskWithPathArgumentsTimeout("/usr/bin/open", ["/Applications/Safari.app", "http://www.google.com"], 30);
UIATarget.captureScreenWithName('test.png');

コマンドライン:

instruments -t /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate Safari.app -e UIASCRIPT cap.js

私のアプローチの何が問題になっていますか?ありがとう!

4

1 に答える 1

0

問題は、ターゲットオブジェクトではなくUIATargetクラスでcaptureScreenWithNameメソッドを呼び出したことです。

そのはず:

UIATarget.localTarget().captureScreenWithName('test.png');

注:captureRectWithNameについても同じです。

于 2012-07-10T14:53:16.003 に答える