Can we use UI Automation tools with the iPhone Sim

2019-02-15 14:02发布

I’ve been using the new UI automation tools with Instruments and the iPhone SDK 4.0, but so far I haven’t been able to get it to run under the iPhone Simulator. I’ve tried setting the target to every location possible—my build folder, the app folder in ~/Library/Application Support/iPhone Simulator, etc.—but I get an error message when I try to run it:

Unexpected error in -[UIATarget_0x5a1e3b0 frontMostApp], /SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m line 437,

Has anyone gotten this to work?

2条回答
疯言疯语
2楼-- · 2019-02-15 14:24

Yes in theory you can. In practice there are a lot of problems. But did you check if simulator has the accessibity.plist?

I found this on https://devforums.apple.com/message/261883#261883 they recommend: "Copy ~/Library/Application Support/iPhone Simulator/4.0/Library/Preferences/com.apple.Accessibility.plist to ~/Library/Application Support/iPhone Simulator/4.0.1/Library/Preferences" and it worked for me.

查看更多
叛逆
3楼-- · 2019-02-15 14:35

If you have trouble getting the correct target, running your project with a different instrument (like Leaks) should put your executable into the "choose target" list. That is at least one potential error source you can exclude that way.

查看更多
登录 后发表回答