Does UIAutomation work on the simulator?

I am new to iPhone Automation and the UIAutomation Framework introduced by iOS4. I recently use UIAutomation to automate testing an application on iPhone Simulator using tools, but it gives me an error, for example, "An unexpected error occurred in - [UIATarget_0x5a20d20 frontMostApp], / SourceCache / UIAutomation_Sim / UIAutomation-37 / Framework / UIATargetElements.m line 437"

I also tried this by running the application on the iPhone 3G device after updating it using iOS4. But the tool shows me the warning "Automation is not supported on this device."

My question is: does UIAutomation work on the simulator or not? Do I need to buy a new device, such as 3GS or iPhone 4.0, to launch it? Thanks in advance...

+4
source share
2 answers

There was the same problem and found the answer at https://devforums.apple.com/message/261883#261883

multitasking is required on the device.

on the simulator you need plist: com.apple.Accessibility.plist.
"copying your com.apple.Accessibility.plist from your 4.0 folder to your 4.0.1" did the trick for me.

+7
source

You are missing this piece of code

// get the application descriptor

var app = UIATarget.localTarget (). frontMostApp ();

try it...

0
source

All Articles