4

I am new to iPhone Automation, and UIAutomation framework introduced by iOS4. Recently I am using UIAutomation to automate testing app on iPhone Simulator via instruments but it gives me an error like "Unexpected error in -[UIATarget_0x5a20d20 frontMostApp], /SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m line 437"

I have also tried it by running app on the iPhone 3G device after updating it with iOS4. But the instrument shows me the warning "Automation is not supported on this device".

My Question is, does UIAutomation works on simulator or not? Do i need to purchase a new device like 3GS or iPhone 4.0 to get it run? Thanks in advance...

nschum
  • 15,322
  • 5
  • 58
  • 56
Gopal Dube
  • 41
  • 2
  • possible duplicate of [Can we use UI Automation tools with the iPhone Simulator?](http://stackoverflow.com/questions/3397733/can-we-use-ui-automation-tools-with-the-iphone-simulator) – Brad Larson Aug 09 '10 at 17:58

2 Answers2

7

Had the same problem and found the answer on https://devforums.apple.com/message/261883#261883

on the device you need multi-tasking.

on the simulator you need a 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.

clauswey
  • 1,706
  • 1
  • 12
  • 15
0

You are missing this part of the code

//gets the handle for the application

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

try this...

Kiran Koundinya
  • 181
  • 1
  • 2
  • 14