2012-05-14 4 views
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 

私のアプローチが間違って何ですか?ありがとう!

答えて

0

問題は、ターゲットオブジェクトの代わりにUIATargetクラスでcaptureScreenWithNameメソッドと呼ばれています。

それは次のようになります。

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

注:captureRectWithNameについて同じ。

関連する問題