Can we use UI Automation tools with the iPhone Simulator?

▼魔方 西西 提交于 2019-11-30 18:50:44

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3397733/can-we-use-ui-automation-tools-with-the-iphone-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!