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 :(得分:0)
问题是您在UIATarget类而不是目标对象上调用了captureScreenWithName方法。
应该是:
UIATarget.localTarget().captureScreenWithName('test.png');
注意:captureRectWithName相同。