A
A
agent_22032021-11-30 22:55:33
Python
agent_2203, 2021-11-30 22:55:33

Why can't I run app in appium along with proxy in Android Virtual Device?

(I entered these tags, since I don’t see a tag for this question, please don’t hit) I
launched the android emulator through Android Studio, in the Settings -> Proxy tab I set dynamic proxies with a change every 90 seconds (if it’s important)
I also raised appium and wrote this script:

from appium import webdriver

cap = {
  "platformName":"Android",
  "platformVersion":"9",
  "deviceName":"Android Emulator",
  "app":"C:/Users/neev/project/***.apk"
}

try:
  driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_capabilities=cap)
except Exception as e:
  print(e)

input()


The application starts in the emulator and after a while it closes with the following error:

Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    at UIA2Proxy.command (C:\Users\neev\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)


Traceback:

Traceback (most recent call last):
  File "D:\f\main.py", line 10, in <module>
    driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_capabilities=cap)
  File "C:\Users\neev\AppData\Local\Programs\Python\Python310\lib\site-packages\appium\webdriver\webdriver.py", line 273, in __init__
    super().__init__(
  File "C:\Users\neev\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\neev\AppData\Local\Programs\Python\Python310\lib\site-packages\appium\webdriver\webdriver.py", line 364, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, parameters)
  File "C:\Users\neev\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "C:\Users\neev\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    at UIA2Proxy.command (C:\Users\neev\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)


When I remove the proxy, everything is fine, no one knows what could be the problem? Googled and couldn't find anything similar.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question