views:

385

answers:

2

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?

+3  A: 

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.

clauswey
Unfortunately, this did not work for me. Thanks for the tip, though.
Jeff Kelley
This works perfect. Thanks!
toofah
@Jeff - Did you restart the Simulator? You need to do that for the new property list to be loaded. Also, you need to do this for 4.0.2 if you are using that SDK.
Brad Larson
A: 

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.

clauswey