question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting an error while executing the test case with real iPhone 6 (12.1.2) device.

See original GitHub issue

The problem

When I am executing the test case on real iPhone device my application is getting opening and then abruptly closed and this process is being repeated several times before throwing an error:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up 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.

The execution Video

https://drive.google.com/open?id=1azEPtRyMvr277jRM3I7Ei1t3DnzZ7ztg

Environment

  • Appium version (or git revision) that exhibits the issue:
  • Desktop OS/version used to run Appium: Mac OS Mojave (10.14)
  • Node.js version (unless using Appium.app|exe): v11.4.0
  • Npm package manager: 6.4.1
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: iPhone 6 - v 12.1.2
  • Appium CLI: 1.11.0-beta.3 And Appium.app: 1.10.0 ( I have tried on both)

Details

I have followed steps from https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md in order to setup the execution on real iOS devices. And I have setup it correctly. I verified it by deploying the WebDriverAgent manually from the XCode.

To make sure the successfull installation of provisioning profiles in WebDriverAgent.xcodeproj I have executed below command in the project directory:

xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=badded265a19dea8b1258392e6bf649a1ffc60ec IPHONEOS_DEPLOYMENT_TARGET=12.1.2

Gist of the above command found here: https://gist.github.com/prat3ik/4cc3cffa0871055073f2837185cd6f39

Also to completely verify, I have accessed the WebDriverAgent server status: screenshot 2019-03-01 at 5 49 18 pm

Moreover I have tried to restart the device and unistalled the WebDriverAgent from my device manually also did restart my machine.

Link to Appium logs(With Enabled XCode logs)

https://gist.github.com/prat3ik/8d950da78419523be97991220036ccef

Code To Reproduce Issue

import unittest
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '12.1'
desired_caps['automationName'] = 'XCuiTest'
desired_caps['deviceName'] = 'iPhone6'
desired_caps['udid'] = 'badded265a19dea8b1258392e6bf649a1ffc60ec'
desired_caps['showXcodeLog'] = 'true'
desired_caps['app'] = 'Settings'


driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Mar 1, 2019

[WD Proxy] Got an unexpected response: [debug] [XCUITest] Failed to create WDA session (An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Cannot read property ‘sessionId’ of undefined). Retrying…

To me it looks like the client code tries to start multiple sessions on the same device at the same time and nothing of these succeeds.

0reactions
lock[bot]commented, Mar 10, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

failed to prepare device for deplo… | Apple Developer Forums
In xCode Go into Window/Devices and Simulators. Select the device you are using · It will likely show that the Device is unavailable...
Read more >
12.1+ simulators are missing in Xcode 11! - Apple Developer
I've got an Xcode 10.3 project that uses 12.2 and a new Xcode 11.2 project that uses 12.4 and both are missing simulators...
Read more >
Cannot test on iOS 11 device | Apple Developer Forums
It is an iPhone 6s running iOS 11.4.1. I can run my app on the device, but I can't run any unit tests....
Read more >
If you can't update or restore your iPhone or iPod touch
Put your device in recovery mode and set it up again · Make sure that your Mac is up to date. · On...
Read more >
Xcode error: Failed to prepare device for development
I got this error on Xcode 13.1 when my iPhone Xs MAX updated to iOS 15.3.1. Updating to Xcode 13.2.1 solved the problem....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found