webdriveragentrunner iphoneos12.2-arm64.xctestrun doesn't exist - ios

I want to automate ios app using appium.
The thing is that I am getting this error when I use appium inspector in order to open my installed application for the first time:
xcodebuild failure: "xcodebuild failed with code 65"
I followed different solutions I found online (like enable automatically manage signings in webdriveragent project, code signing identity...) but I am still getting this error.
Seems that this path does't exist in my computer.
Is there a way to fix this issue?
Thanks

You need to walk through Appium XCUITest Driver Real Device Setup article and perhaps Real device security settings chapter of the appium-xcuitest-driver documentation.
Most probably you have wrong XCode configuration with regards to signing mobile application packages
The easiest option would be considering using Appium Studio which has a simple wizard allowing creation of iOS provisioning profile in few clicks.

In my case I had to use one command from Full manual configuration
Steps that I made:
install appium:
npm install -g appium
Successfully build webDriverAgentRunner from xcode.
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<id_of_your_device>' test
Don't kill the console
Open appium desktop and try to connect

Related

Unable to run WebDriverAgent on the real device using Appium Desktop

I am unable to run WebDriverAgent on a real device using Appium Desktop. I have attached gist for the error log.
I have tried some solution from github/appium but it did not solve my issue.
server log
https://gist.github.com/guowang94/ec923da6a3b77aca06a902c450200238
appium.app error message
https://gist.github.com/guowang94/ef2c5bb5bcc617baa2af19418e9a8b8e
I expect the WebDriverAgent to be running in the real device so that I can proceed to my next task but I am unable to install and run WebDriverAgent on the real device
Your logs have both the problem:
An empty identity is not valid when signing a binary for the product type 'UI Testing Bundle'. (in target 'WebDriverAgentRunner')
which indicates incorrect XCode configuration with regards to signing the WebDriverAgentRunner-Runner.app
and the solution:
Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 .... Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
If the official guide is not clear you can follow steps from the Configuring Appium Environment for iOS Real Device article.
You can also consider Appium Studio which makes the process of setting up Appium testing on real iOS devices much easier.

is 'APP' capability REQUIRED for WDA installation?

I'm trying to run an appium script with a real iOS device. I am currently getting this error:
Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65". Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Apparently this error is associated with security issues at noted here, but I've already completed that step and it's still not working. So then I thought maybe this is b/c my appium script does NOT set the 'APP' capability. 'APP' capability is of course is the full path to the application that is under test. The appium documentation here obviously doesn't indicate which settings are required if any. My question is will the Webdriver Agent not get installed on the device if the 'APP' capability is not set and thus throwing the error above?
You can right-click on the appium app (which is in ur application folder) you are using > show package contents > search for .xcodeproj > you will see a couple of projects including web driver. Now open web driver agent Xcode project and use an apple developer account to code sign it.
If you have already done this, then please update your question with appium capabilities that you have set.

how to debug with real device using xcode tools in terminal

I've already have Xcode tools installed on my mac and now I can build my iOS game project like this:
xcodebuild -scheme "Game Scheme"
and the next thing I want is to install and run the generated app (using the command above) on a real device (connect to mac).
I'm wondering if there is a command such as (I read the document about xcrun but still can not figure out how to get this done):
xcrun "my game.app" -l
to install the game on my device, run it, and print all the logs in my terminal just like Xcode did in the console.
Any advice will be appreciated, thanks :)
Doing so is a complicated process that requires reverse-engineering the MobileDevice framework interface or the underlying protocols.
Fortunately, various parties have done the work for you.
https://github.com/phonegap/ios-deploy
http://www.libimobiledevice.org/

Xcode command line install to device

I am trying to install an app from XCode onto my device from the command line. I have tried several of the "xcodebuild" command line options which do build, clean, install, etc fine. I have also searched for various solutions.
I was able to execute this command but it just builds to a folder.
xcodebuild install -scheme "My App" -destination 'platform=iOS,id=mydeviceid'
I am able to take that folder from my hard drive and sync to the physical device using iTunes so all the build steps are being completed successfully. However, it does not "run" on the device like when Build and Run are executed in XCode.
There are some 3rd party solutions but I can't believe there isn't some native xcodebuild switch to do that. Does anyone have suggestions?
Thank you
There is no native xcodebuild switch to install to a device.
You need to fallback to third-party options:
$ brew install ideviceinstaller
ios-deploy
You can try to use Apple Configurator 2 (available in the App Store) and install the cfgutil command line tool.
.
Ignore the fact that ^ says "Uninstall Automation Tools...", if you haven't installed already, it will say "Install Automation Tools...".

How to install iOS application from src, .app, or .ipa via command line to hardware device

For test automation (GUI test, not XCUnitTest) purposes, I need to install an iOS app onto a physical hardware device.
I'm looking for:
a replacement to Fruitstrap (it has been abandoned)
or a way to perform XCode's "Build & Run" action on a target device
I've tried:
using xcodebuild and pointing the -destination argument at the target device and providing build actions of clean and install
It finds the target device and begins cleaning and then installing.
At the end of all the files being compiled and the app being signed, I get a success message
** INSTALL SUCCEEDED **
But, alas, no app is installed on my phone.
This is my full xcodebuild command:
xcodebuild
-destination platform=iOS,id=######## \
clean install
Here's the gist of the output
Creative suggestions welcome.
I'm considering writing an applescript if needed, but wish there was a better way.
Fruitstrap is, for the time being, working and installing the app correctly.
/path/to/fruitstrap \
install -id ##udid### \
--bundle "/Users/#######/path/to/application.ipa"
Other, more maintained solutions are still welcome.
Limitations:
Need to have a prebuilt .ipa file
Target device must be signed with a provisioning profile that includes the target device's udid

Resources