Before Starting Just watch this youtube video for configuring Appium for Automating iOS applications: Configure Appium For iOS
Pre-Requisite:
There are some of the basic pre-requisites for Appium 1.6.3 to work with IOS 10 to setup for automating test cases.
- Mac Os > 10.11 (Not possible in windows)
- Xcode > 8.1
- IOS 10
Setting up environment:
Some of the steps listed for setting up appium 1.6.3
SR | Steps | Solution/Commands |
1. | Install HomeBrew | ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” |
2. | Install Node JS | brew install node |
3. | Install Lib-imobile-device | brew install libimobiledevice –HEAD |
4. | install ideviceinstaller | brew install ideviceinstaller |
5. | carthage | brew install carthage |
6. | Install Ios-Deploy | npm install -g ios-deploy |
7. | Install Xcpretty | gem install xcpretty |
Lastly download and install Appium using npm, Command: “npm install -g appium@beta“. This command will download and install latest beta build. If you need latest appium build just dont include @beta with command.
After that there few configurations for setting up appium.
Manual Configuration:
There are some manual configuration for webdriver to setup and install on device:
- Open terminal go to
node_modules/appium-xcuitest-driver/WebDriverAgent
(this path is relative to your appium installation). Run following commands-
mkdir -p Resources/WebDriverAgent.bundle
-
sh ./Scripts/bootstrap.sh -d
-
- Now open
WebDriverAgent.xcodeproj
in Xcode. Select yourdevelopment team
for theWebDriverAgentLib,
WebDriverAgentRunner
and integration Apps targets. This should also auto selectSigning Certificate
. Now there is trick while tweaking these targets. Please check this link. - Build
WebDriverAgent
once to verify all above steps worked.-
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=' test
-
Now start appium on command line using “appium -p <PORT>” and throwing commands through your script.
Configure Appium For iOS
Please comment for any kind of related queries.
do we need developer account in order to sign the WedriverAgent
LikeLike
Yes, You need developer account. It can be free developer account as well.
LikeLike
For any help with regards to mobile application automation, you can subscribe my youtube channel https://www.youtube.com/channel/UCb4jv3Oor88-EtD7NYR1Riw
LikeLike
How do we get a free apple developer account?
LikeLike
Tried that, but the build failed; getting error:
LikeLike
@Jon Please check your app is verified by navigating to General > Device Management
LikeLike
Hi Followed the steps which you mentioned but appium log is coming this errro
[Xcode] 2017-06-04 15:08:14.994 xcodebuild[12928:83831] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8f612aba60 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}
[Xcode]
[Xcode] 2017-06-04 15:08:14.994 xcodebuild[12928:83831] Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping – no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping – no restart will be attempted}
[Xcode]
[Xcode] TEST EXECUTE FAILED
[Xcode]
[Xcode]
[XCUITest] xcodebuild exited with code ’65’ and signal ‘null’
[debug] [BaseDriver] Event ‘wdaStartFailed’ logged at 1496578095048 (15:08:15 GMT+0300 (+03))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
Can you please help?
Thanks,
Sanjay
LikeLike
You checked whether WebDriver app got installed in your device?
LikeLike
I checked webdriver app not installed on my device? Can you please guide how I do the same.
LikeLike
As you can see in logs ” it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. ”
So there are two reasons for failure:
1. Invalid code signature: Open WebDriverAgent.xcodeproj and check 3 given targets are signed?
2. Profile not trusted: But for that WebDriver app must get installed in your device, then you can trust certificates in your device. Settings>General>Device Management> Trust Certificates
LikeLike
Thanks for reply I signed all these 3 targets
But still the same issue
LikeLike
For any help with regards to mobile application automation, you can subscribe my youtube channel https://www.youtube.com/channel/UCb4jv3Oor88-EtD7NYR1Riw
LikeLike
Thanks for your post! this was really helpful.
LikeLike
For any help with regards to mobile application automation, you can subscribe my youtube channel https://www.youtube.com/channel/UCb4jv3Oor88-EtD7NYR1Riw
LikeLike
Hi…
I want to ask about the second step ” there is trick while tweaking these targets. Please check this link.”
For product bundle id, it should be “com.facebook.test.xxxxx” or it should be changed to our own bundle id?
Thank you,
LikeLike
Hi…
I want to ask about the second step ” there is trick while tweaking these targets. Please check this link.”
For product bundle id, it should be “com.facebook.test.xxxxx” or it should be changed to our own bundle id?
Thank you,
LikeLike
this is a big big help for me! Thanks a bunch
LikeLike
For any help with regards to mobile application automation, you can subscribe my youtube channel https://www.youtube.com/channel/UCb4jv3Oor88-EtD7NYR1Riw
LikeLike
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=’ test
After I run this command, it hangs here
Test Suite ‘All tests’ started at 2017-11-29 15:34:36.889
Test Suite ‘WebDriverAgentRunner.xctest’ started at 2017-11-29 15:34:36.892
Test Suite ‘UITestingUITests’ started at 2017-11-29 15:34:36.893
Test Case ‘-[UITestingUITests testRunner]’ started.
t = 0.00s Start Test at 2017-11-29 15:34:36.898
t = 0.01s Set Up
2017-11-29 15:34:36.923991+0530 WebDriverAgentRunner-Runner[365:16913] Built at Nov 29 2017 15:34:11
2017-11-29 15:34:36.977462+0530 WebDriverAgentRunner-Runner[365:16913] ServerURLHere->http://192.168.15.35:0<-ServerURLHere
and doesn't move forward, please help.
LikeLiked by 1 person
It means webdriveragent is successfully installed in your device, you can proceed with appium
LikeLike
Throwing below error, its already signed with a developer account:
[WebDriverAgent][39m xcodebuild exited with code ’70’ and signal ‘null’
Need help
LikeLike
Is there a way to get around needing an Apple Developer Account? I keep getting this in Xcode when trying to setup the WebDriverAgentRunner/Signing & Capabilities:
Communication with Apple failed
Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/
LikeLike