WebDriverException: Message: 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

While execution of test cases of test suite after some case of execution it is showing the error

“WebDriverException: Message: 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” and execution is stopped.

I am working on the iOS application automation using XCUI test.

Most probably same system port is used in between execution.

Thanks for your reply …Let me check it by fixing the port number.

I was able to fix this issue, connected to emulator device. Make sure ADB devices commands work when emulator is connected to machine.

Hello guys, I have faced the same problem, but now I just find the reason & also the solution. I realized that the error occurred when I made a test case that contains both “close server session” & “open new server session” command. I Think when running that kind of test case, the two different appium sessions overlap with each other, and then the error occurred. So my solution to this problem was very simple because I just separated “close server session” & “open new server session” command into two different test case, and then boom, the error has not occurred until now