iOS 8.1 Real Devices: You need to enable "UI Automation" Setting

Running Appium on real devices with ios 8 or 8.1 you need to enable a new Setting.

Under the Settings app, there will be a “Developer” item, choose it and enable the “UI Automation” toggle.

I honestly looked for the setting a dozen times and it wasn’t there on my iPhone 5s. It appeared on my iPhone 6 as soon as I plugged it in to USB.

Not sure how to get it to appear when you don’t see it, but try rebooting everything obviously. Maybe try running XCode Instruments manually?

If you don’t enable this, instruments crashes as soon as it starts. If you try running an Automation script from XCode, it just fails with “An error occurred while trying to run the script”. You might see “WebKit Threading Violation” in your log, but ignore it, the real smoking gun is: “UIAScriptAgentSignaledException”

7 Likes

Is there any other option for running the application in real iOS device?

Uh, you need to enable UIAutomation in order to test on Real iOS Devices using Appium.

Thanks for your reply @jonahss,
Can you please let me know how to enable the UIAutomation ?

That’s what I explain in the top of this page. Plug your phone into a mac running Xcode, open settings app. Then open “Developer Settings” like in the screenshot. Then tab “Enable UIAutomation”

1 Like

Thanks @jonahss. I didn’t get Enable UI Automation in iPadAir but the option was available on iPod touch. I have enable the UIAutomation but it looks like the attached device is not available. Is there any way to find the list of devices that are connected to mac? like adb devices for windows. While running the code I got the following error,
error: Failed to start an Appium session, err was: Error: Could not find a device to launch. You requested ‘iPod touch(8.1 Simulator)’, but the available devices were: iPad2, iPad Air, iPad Retina, iPhone 4s, iPhone 5 iPhone 6 and iPhone 6 Plus.

If you see the error it says iPod touch(8.1 Simulator), I had connected the real device to the machine though it shows it as simulator, is this the expected?

To run the test in real device, do I need to configure anything else ?

Thanks in Advance,
Pavithra.

@PavithraRavichandran

  1. As @jonahss explained, make sure that you have enabled UIAutomation on the device.
  2. Launch xcode and see whether you can see your device under Window/Devices.
  3. If you are using appium IDE, select the Force device checkbox and add your device in the dropdown next to it.

btw is your device added to Apple dev program ???.

Thanks,
Amarnath Rayudu

1 Like

@AmarnathRayudu, Thanks for your reply. I can see my device name in xcode. No I didn’t add my device to Apple dev program :disappointed:.

@PavithraRavichandran, It is mandatory to add your device to Apple Dev program.

1 Like

Hi AmarnathRayudu,

The problem you are facing is because of missing SDK for your device
add SDK of your device version will solve the issue and shows the developer option in settings