Script crashes with OSError: RPC server not started! or ReadTimeoutError

Sometimes you may experience problems with adb connection. They usually look like this: the script gets stuck on some moment for 1-2 minutes and then prints a stacktrace.

Look at the last line of the stacktrace. Usually adb connection error can be identified by  one of OSError: RPC server not started! or ReadTimeoutError. This means that your computer cannot send commands to your device or didn’t receive a response from the device.

So, what you should do

Try these steps one by one until one of them helps. If no one helps, please describe your case here in comments: I’ll try to help you myself and improve this post.

1. Disconnect your device(s) -> adb kill-server -> connect a device -> confirm connection on the device -> check that it’s successfully connected via adb devices

2.  Disconnect your device(s) -> kill adb process in Activity Monitor (or Task Manager in Windows) -> connect a device -> confirm connection on the device -> check that it’s successfully connected via adb devices

3. Disconnect your device(s) -> reboot both computer and the device -> connect the device -> confirm connection on the device -> check that it’s successfully connected via adb devices

4. Run adb --version. My version is 1.0.41 and it works fine. If you have older version, upgrade (the way depends on how you installed adb)

5. Maybe something’s wrong with a USB port or a cable? Try another port, another cable. Sometimes using USB2.0 instead of USB3.0 helps.

If problem was fixed once, but occurs again and again, consider using connection via WiFi. Probably your cable is damaged inside and disconnects sometimes.

Community

Discord Server
Telegram Chat
Patreon Page

Leave a Reply