DrPatience DrPatience - 27 days ago 20
Java Question

Can't run Appium tests on iOS 10 on real device

Since updating my device and xCode to iOS 10 and Xcode 8, I have been unable to successfully setup Appium testing on a real device. However, I works fine on the simulator. Below is my setup of capabilities:

DesiredCapabilities cap = new DesiredCapabilities();

File f = new File("/Path/App.ipa");

cap.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.6.0");
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.1.1");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6 (Model MG472B/A)");
cap.setCapability(MobileCapabilityType.UDID, "20a548dc87a87ecddf7ab3975a4b5f3395ac1a0");
cap.setCapability(MobileCapabilityType.APP,f.getAbsolutePath());
cap.setCapability("bundleId", "co.uk.xx");
cap.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest");
cap.setCapability("noReset", "true");

try {
driver = new IOSDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}


I'm faced with the error below:

'An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: 'xx'.

Appium Log Below:

[HTTP] --> POST /wd/hub/session {"desiredCapabilities": {"automationName":"XCUITest","app":"/Users/xx/Documents/xx/AppiumTesting/xx.ipa","platformVersion":"10.1.1","platformName":"iOS","deviceName":"iPhone 6 Device","bundleId":"co.uk.xx","udid":"20a548dc87a87ecddf7ab3975a4b5f3395ac1a0","noReset":"true"}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{"automationName":"XCUITes...

[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] automationName: 'XCUITest'
[Appium] app: '/Users/xx/Documents/xx/AppiumTesting/xx.ipa'
[Appium] platformVersion: '10.1.1'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'iPhone 6 Device'
[Appium] bundleId: 'co.uk.xx'
[Appium] udid: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0'
[Appium] noReset: 'true'
[debug]
[XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: eb42232d-b465-4518-9a20-6dd33ac55cbc
[debug] [XCUITest] Xcode version set to '8.1'
[debug] [XCUITest] iOS SDK Version set to '10.1'
[debug] [XCUITest] Available devices: 20a548dc87a87ecddf7ab3975a4b5f3395ac1a0b
[XCUITest] Error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0'
at XCUITestDriver.determineDevice$ (lib/driver.js:392:17)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0'
at XCUITestDriver.determineDevice$ (lib/driver.js:392:17)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype[debug] [XCUITest] Reset not set, not ending sim
.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[MJSONWP] Encountered internal error running command: Error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0'
at XCUITestDriver.determineDevice$ (lib/driver.js:392:17)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[HTTP] <-- POST /wd/hub/session 500 1292 ms - 212

sai sai
Answer
Available devices: 20a548dc87a87ecddf7ab3975a4b5f3395ac1a0b [XCUITest]    Error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0' .

This is the error you are getting you are giving wrong udid. you are missing 'b' in the end