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.

Socket hangup error on ios real device

See original GitHub issue

The problem

While clicking a element, getting the page source or sometimes with finding an element. The socket is hanging up and causing the tests to fail.

Environment

  • Appium version (or git revision) that exhibits the issue: appium --version 1.13.0
  • Last Appium version that did not exhibit the issue (if applicable): appium 1.10.x
  • Desktop OS/version used to run Appium: 1.13 (I am not seeing this issue on appium desktop version)
  • Node.js version (unless using Appium.app|exe): 6.9.0
  • Npm or Yarn package manager: npm
  • Mobile platform/version under test: ios/11.4.1
  • Real device or emulator/simulator: Real device (iphone7)
  • Appium CLI or Appium.app|exe: appium client

Details

appium : 1.13 Macos : 10.14 libimobiledevice : head xcode : 10.2.1 python : 3.7.3 Real Device: iphone7 (11.4)

Link to Appium logs

Create a GIST which is a paste of your full Appium logs, and link them here. https://gist.github.com/sharecommute/7c51b34d2d0227f008248853dd1532d8

Noticable Errors: [WD Proxy] Got an unexpected response: {“code”:“ECONNRESET”} [debug] [W3C (7554bc26)] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: socket hang up [debug] [W3C (7554bc26)] at doJwpProxy (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:547:13) [debug] [W3C (7554bc26)] at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:308:9) [HTTP] <-- POST /wd/hub/session/7554bc26-9adf-4f0b-9cef-

Code To Reproduce Issue [ Good To Have ]

In python, i used

  1. self.driver.find_element_by_ios_predicate(<element>) (intermittent)
  2. self.driver.click_element(<element>) (intermittent)
  3. self.driver.page_source ( this is for sure causing the socket hang up)

Note: Getting the page source manually using the Desktop app is not getting any socket hang up, i can copy the page source and paste it into a editor.

Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.

Please git clone https://github.com/appium/appium and from the sample-code directory, use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

2reactions
jonathan-tan-vikicommented, Jun 20, 2019

Hi, I am also facing the same problem - except that the same device worked fine on one machine but didn’t work on another.

Discovered that the problem was that one machine was ahead in commits for usbmuxd. I replaced it with my old version and I didn’t have this problem anymore.

Perhaps you could give it a shot in trying to replace usbmuxd with an attached older commit. If you used brew to install, you can run brew info usbmuxd to find the install location and just replace it manually. You also might need to change the name of the subfolder with the to match the git SHA which brew is using. (Kind of a dirty solution for now but we’ll work it out later if it works for you too)

Sorry i’m kinda new to this so if there’s a better way of doing this please let me know haha.

usbmuxd.zip

0reactions
lock[bot]commented, Jun 24, 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

"Error: socket hang up" in iOS tests · Issue #13017 - GitHub
It's may happens in random place in test. When the test starts it deletes old simulator and creates new one on mac-mini with...
Read more >
Getting server error( socket hang up ) - Appium Discuss
Hi All, I am getting the below error while I am running the script in emulator ( Real device was fine ) Unable...
Read more >
Getting socket hang up error while running appium scripts ...
Socket hang up mostly happens because the system port (8200 by default) is under using after tearing down. System port is something ...
Read more >
APNs socket hang up error. | Apple Developer Forums
From 2018/02/09, socket hang up occasionally happens when connecting to APNs. It is still occasionally still. The connection method to APNs is TLS...
Read more >
Mobile Testing (Common issue with iOS real device) - Tips ...
WebDriverAgentRunner.xctrunner' on IOS device and how to troubleshoot? 41. “Unable to start the application. Original error: socket hang up” ...
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