Reputation: 125
I've searched a lot about this error. I've done a lot of tutorials and nothing works:
I've created a test iOS project and it seems that I have everything installed to start working with appium in iOS
bacelar@Brunos-MacBook-Pro-2 Test % appium-doctor --ios
info AppiumDoctor Appium Doctor v.1.15.1
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 12.13.1
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.34.0
info AppiumDoctor ✔ HOME is set to: /Users/bacelar
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
But when I start inspector session on appium desktop I get the following error:
Encountered internal error running command: Error: Could not find a driver for automationName 'XCUITest' and platformName 'iOS'. Please check your desired capabilities.
Here is the appium log:
[HTTP] {"desiredCapabilities":{"app":"/Users/bacelar/Curatio/automatedTests/iOS/test_project/Test/build/Release-iphonesimulator/Test.app","automationName":"XCUITest","deviceName":"iphone 11","noReset":true,"platformName":"iOS","platformVersion":"13.4","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/bacelar/Curatio/automatedTests/iOS/test_project/Test/build/Release-iphonesimulator/Test.app","automationName":"XCUITest","deviceName":"iphone 11","noReset":true,"platformName":"iOS","platformVersion":"13.4","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1588813098829 (17:58:18 GMT-0700 (PDT))
[BaseDriver] Event 'newSessionStarted' logged at 1588813098836 (17:58:18 GMT-0700 (PDT))
[MJSONWP] Encountered internal error running command: Error: Could not find a driver for automationName 'XCUITest' and platformName 'iOS'. Please check your desired capabilities.
[MJSONWP] at AppiumDriver.getDriverAndVersionForCaps (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/appium.js:226:11)
[MJSONWP] at AppiumDriver.getDriverAndVersionForCaps [as createSession] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/appium.js:300:66)
[MJSONWP] at AppiumDriver.executeCommand (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:376:19)
[MJSONWP] at AppiumDriver.executeCommand (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/lib/appium.js:482:26)
[MJSONWP] at executeCommand (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:306:34)
[MJSONWP] at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:432:15)
[MJSONWP] at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[MJSONWP] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:137:13)
[MJSONWP] at Route.dispatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:112:3)
[MJSONWP] at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:281:22
[MJSONWP] at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[MJSONWP] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[MJSONWP] at logger (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/morgan/index.js:144:5)
[MJSONWP] at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[MJSONWP] at trim_prefix (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:317:13)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:284:7
[MJSONWP] at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[MJSONWP] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[MJSONWP] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/body-parser/lib/read.js:130:5
[MJSONWP] at invokeCallback (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:224:16)
[MJSONWP] at done (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:213:7)
[MJSONWP] at IncomingMessage.onEnd (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:273:7)
[MJSONWP] at IncomingMessage.emit (events.js:182:13)
[MJSONWP] at endReadableNT (_stream_readable.js:1090:12)
[MJSONWP] at process._tickCallback (internal/process/next_tick.js:63:19)
[HTTP] <-- POST /wd/hub/session 500 11 ms - 254
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 1 ms - 57
[HTTP]
What should be done to fix it?
Upvotes: 1
Views: 11070
Reputation: 1
I faced this issue and looked at many solutions, but none that worked. Finally, I updated Appium desktop to v1.18.3 and Appium CLI to v1.19.1. It really works. So, it may be version bug.
Upvotes: 0
Reputation: 125
After long hours searching I found a way to solve it.
The desires capabilities needs to be:
"xcodeOrgId": "XXXXXXXXX",
"xcodeSigningId": "iPhone Developer",
"udid": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"platformName": "iOS",
"deviceName": "DEVICE NAME",
"bundleId": "BUNDLE ID",
"automationName": "XCUITest"
Executing the steps from this tutorial: https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
I was getting errors and after executing this command on terminal
security unlock-keychain -p ****
Everything is working, I can inspect my app and run my automated tests.
Hope it helps if you are getting the same issue.
Upvotes: 0
Reputation: 31
I think the values that you pass in your desired capabilities for deviceName
, platformName
, platformVersion
should match to a simulator that is there in your Xcode so that appium can find and start it.
The below set of capabilities has worked for me in the past:
File demoAppPath = new File("Demo App");
File demoApp = new File(demoAppPath, "Demo.app");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.APP, demoApp.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 8");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "13.2");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
Note that i had a simulator in my Xcode with the name iPhone 8
and has the iOS version 13.2
. Hope it helps !!
Upvotes: 1