Reputation: 471
I am trying to run appium scripts with below setup:
Appium version : 1.6.4
Xcode : 8.3.2
Mac : 10.12.4
iPhone : 10.3.1
Below is the code I am using to launch safari Browser on iPhone real device.
desCapabilities = new DesiredCapabilities();
desCapabilities.setCapability("platformName","iOS");
desCapabilities.setCapability("deviceName", "Ananda's iPhone");
desCapabilities.setCapability("platformVersion", "10.3.1");
desCapabilities.setCapability("app", "com.apple.mobilesafari");
desCapabilities.setCapability("udid", "******");
iOSDriver = new IOSDriver<MobileElement>(new URL("http://" + nodeUrl + ":" + nodeUrlPort + "/wd/hub"), desCapabilities);
I am getting the error and please find the logs below:
[MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:374:15)
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)
at process._tickCallback (internal/process/next_tick.js:109:7)
Upvotes: 3
Views: 48212
Reputation: 253
Can try these: Install appium version: 2.0.0-beta.46
npm install -g appium@next
Then install the driver for xcuitest:
appium driver install xcuitest
Go to the folder: /Users/${your_user}/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent
If yo have issues with signing, then open WebDriverAgent.xcodeproj with xCode and sign it.
Then run the command:
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id='{device_id}' test -allowProvisioningUpdates
Upvotes: 0
Reputation: 1
I managed to solve this error this way: You need to install the webdriver on your simulator. To do this, follow the steps described in the documentation https://appium.github.io/appium-xcuitest-driver/4.24/wda-custom-server/
Important: Select WebDriverAgentRunner project and build his with button Test (like on the screen https://prnt.sc/6CTaW_InJK2v). After that when you launch session on Appium, webdriver agent will install on your simulator and fixed error.
Upvotes: 0
Reputation: 1
Getting error : with new webdriveragent 8.5.6 ios -17.4.1 appium - latest xcode - 15.3 i have replaced the webdriveragent folder (except build) in appium -GUI server - open packages - node modules. the xcode build gets successful but appium inspector gives error strong text
Upvotes: -1
Reputation: 11
I ran into the same problem with iOS 16.4. Here is how I solved it:
1- In case of any OS upgrade(iOS), the framework gets disturbed as the other apps(Appium version/xcode/mac os) become unsupported. We need to make sure all the apps and OS should be compativle for the updated iOS version, we need to upgrade xcode as well as Mac OS(for latest xcode version, if required).
2- We might get errors like ‘Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65’ or ‘A valid provisioning profile for this executable was not found.’
3- Check the signing and capabilities for webdriveragentrunner and webdriveragentlib, it should be signed in using a proper developer account
4- Try running the tests again and check if the error isn’t coming anymore. In case the same errors still comes we need to do the next steps mentioned below
5- In such cases we can download the latest webdriver agent from ‘https://github.com/appium/WebDriverAgent/releases’
6- Then delete all files except Build folder from appium gui’s webdriver agent folder
7- From the downloaded folder we can copy all files and paste inside the appium gui’s webdriver agent folder
It worked for me.
Upvotes: 0
Reputation: 352
The reason for this error is that WebDriverAgent not configured [ or installed] properly before launching the app via Appium .
For this, WebDriverAgent needs to be executed once on the iOS Simulator or real device before running tests
Please run the WebDriverAgent Xcode project which is located here on your Mac: /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj
In this Xcode project follow the below steps to build the WebDriverAgentRunner:
[1] Select the WebDriverAgentRunner as active Scheme
[2] Select the iPhone Simulator.
[3] Make sure the runner is signed and Select your team under ‘Signing & Capabilities’ settings of the project
[4] Build and Run the WebDriverAgentRunner runner on simulator by selecting Product > Test from the Xcode menu’s bar
[5] Once Runner is successfully installed on the device, Simulator is ready for launching the app via appium
Upvotes: 0
Reputation: 11
The below solution helped me to resolve the issue:
Download the latest web driver agent from the link:
Go to the Appium desktop and locate webdriveragent
:
$APPIUM_HOME/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent.
Delete the entire appium-webdriveragent folder from the above location in mac.
Paste the webdriveragent-4.9.0 folder downloaded from the above link.
Change the name of the webdriveragent folder name to “appium-webdriveragent”.
Version Used: Appium Desktop v1.22.3 || MacOS Ventura 13.2.1 || Xcode v14.2
Upvotes: 1
Reputation: 91
Common reason for the Appium launch failing with the specified reason is the WebDriverAgent not configured properly before launching the app via Appium .
Found Solution below, which helped me to solve the issue
Upvotes: 0
Reputation: 331
In case anyone is having this issue with xcode 14 and above, doing the below should work:
reference: https://github.com/appium/appium/issues/17497#issuecomment-1275191319
Upvotes: 5
Reputation: 269
This issue took me four days to solve ^_^.
First approach, do not update appium from terminal. Try uninstall and install
npm uninstall -g appium
npm install -g appium
Second approach, run appium from terminal instead of UI appium .
Third approach,
If you still get the this error in Appium Desktop Application, Pls check , Do you install multiple xcode version? When I tried above two approaches, my personal experience was that it didn't work cause appium use latest xcode path ( in appium release note, latest xcode 12.3 does not support yet). So I changed the old xcode path by using
sudo xcode-select -s /Applications/Xcode12.2.app/Contents/Developer
Fortunately it works fine.
Upvotes: 0
Reputation: 471
By following the below steps I have launched the safari browser on iOS real device using Appium.
We need to install WebDriverAgent on Mac using Terminal.
xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id= -configuration Debug
Run the below command to Open the WebDriverAgent using Xcode.
open /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
In Xcode, select the "Automatically manage signing" checkbox for both WebDriverAgent and WebDriverAgentLib.
Run the Xcode Project.
Once build succeed, WebDriverAgent app will be installed in iPhone device.
Finally Run the Selenium code to Launch Safari Browser.
Upvotes: 2
Reputation: 1194
It is opening WebDriverAgent application in the device.Go through below link and configure the WebDriverAgent app for your phone.
Unable to launch ipa file in IOS 10 real Device using appium 1.6.0
Upvotes: 2