I'm new to Appium and currently being stuck with this issue for a week, hope I can get help here.
The issue is I cannot install my test application on my real iPhone device. It always return the same error.
Encountered internal error running command: Error: Could not install app: 'Command 'ios-deploy --id 20846aec46cd64589f6a2b356ef2390b2bc6bc6c --bundle /var/folders/6p/0y20zycd7qz4q14n42zhq29c0000gn/T/2018616-7145-1norgqb.y7mt/Payload/MyAPP.ipa' exited with code 253'
When I try to run only the ios-deploy command, the error return is:
ios-deploy[10050:85931] [ !! ] Error 0xe8008015: A valid provisioning profile for this executable was not found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
As my understanding, the iPhone need to be installed the WebDriverAgent before installed the testing application, however, I don't see anything related to install WebDriverAgent on the progress, it just go straight to install the testing application.
Below is my device info:
My using Desired capabilities:
{
"platformName": "iOS",
"platformVersion": "11.0.1",
"deviceName": "iPhone 5s",
"automationName": "appium",
"udid": "20846aec46cd64589f6a2b356ef2390b323c6bc6c",
"bundleID": "io.apptest.s",
"app": "/path/to/my/MyAPP.ipa"
}
Yes this is actually really tricky, follow these steps, and You might be able to install Your app.
STEP 1. download driver appium-xcuitest-driver
STEP 2. setup You environment:
After the successful installation now apply these steps carefully. After installation, open terminal and run following commands:
brew install libimobiledevice –HEAD
brew install ideviceinstaller
brew install carthage
npm install -g ios-deploy
gem install xcpretty
After successful installation, the terminal will print BUILT SUCCEEDED on the console so moving on step 03 for web driver protocol configuration
STEP 3. Now open Xcode and open the XCUITest project that you will get from the following folder in your mac
/Users/someName/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
Once, WebDriver.xcodeproj is opened so make sure that WebDriverAgentLib, WebDriverAgentRunner, and IntegrationApp is showing on the file as below screenshot.
Now select IntegrationApp and simulator as iPhone X and run the application. As the application is deployed successfully and launches o the simulator successfully so now you are good to go with Appium.
Step 4. Click on Appium application from Launchpad and click on “Start the server v1.7.2″ as the server is started, Click on the “Start Inspector session” to set the required capabilities.
This is bellow for java code, but first try it out with Appium server gui:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “iPhone 7”);
capabilities.setCapability(“platformName”, “IOS”);
capabilities.setCapability(“platformVersion”, “9.3”);
capabilities.setCapability(“browserName”, “safari”);
capabilities.setCapability(“automationName”, “XCUITEST”);
If now is all good to go, write code.
NOTE: Once all is installed and setup, remember to set **automationName as "XCUITest".**
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With