I’m encountering an issue while using Appium Inspector and running mobile automation tests with Selenium in Python. Strangely, everything was working perfectly yesterday, but today, I’m facing an error that I’ve never encountered before. I would greatly appreciate your help in resolving this issue.
Here’s the error message I’m receiving:
[ADB] Using ‘adb.exe’ from ‘C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe’
[debug] [ADB] Running ‘C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server’
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected Android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Could not find online devices
[debug] [ADB] Reconnecting adb (target offline)
[debug] [ADB] Running ‘C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 reconnect offline’
[debug] [ADB] Getting connected devices
[debug] [ADB] Could not find online devices
[debug] [ADB] Reconnecting adb (target offline)
[debug] [ADB] Running ‘C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 reconnect offline’
[debug] [ADB] Getting connected devices
[debug] [ADB] Could not find online devices
[debug] [ADB] Reconnecting adb (target offline)
It appears that Appium is having trouble recognizing my Android device. However, when I run ‘adb devices’ separately, the device is listed as connected and online.
Could you please provide guidance on how to troubleshoot and resolve this issue? I’m using Appium with Selenium in Python, and I’ve tried the following steps:
Restarted the Appium server.
Confirmed that the USB debugging mode is enabled on my Android device.
Checked the ADB executable and port settings in Appium Inspector.
Restarted my computer.
Any insights or suggestions you can provide would be greatly appreciated. Thank you in advance!
Have the same problem. Appium, Windows, Android. Devices paired via Wi-Fi. All works well until the device reconnected. E. g. after I come back to the Wi-Fi zone I check adb devices (there is nothing) then adb connect (connected to 192.168.1.2:5555), then run my script and Appium fails with
File "path\main.py", line 64, in __enter__
self.driver = webdriver.Remote(self.appium_server_url, options=options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "path\venv\Lib\site-packages\appium\webdriver\webdriver.py", line 229, in __init__
super().__init__(
File "path\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 208, in __init__
self.start_session(capabilities)
File "path\venv\Lib\site-packages\appium\webdriver\webdriver.py", line 320, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "path\venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "path\venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, 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 find a connected Android device in 20000ms
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device in 20000ms
at getResponseForW3CError (/usr/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1145:9)
at asyncHandler (/usr/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:485:57)
re-pairing solves the issue, but I think this is not the way it should work
Thank you very much for the link. Could you please explain what server is it about? I can not understand the architecture. There is an Appium server on a machine which sends commands to a driver which is on a device. So, what is the ADB server? When does Appium (?) kill it? If I can use adb commands in a console, does not this mean that adb server runs?
By the way, I had 'deviceName': 'Android', in caps (which is not my device name ). Yesterday I removed it and today I can’t reproduce the error.