I recently faced this error during my development and wanted to share with you all what I learned while debugging this.
First of all, I’d take this blog post as an opporutnity to share with you briefly on how adb works.
There are three major components :
- Adb Client : It’s a client that runs on your development machine and is used to send commands to your device
- Adb deamon : It’s a process that runs on your device/emulator. It’s responsible for receiving the commands that you issue via adb client and execute them in a new thread/process.
- Adb server : This process runs on your host machine and manages communication between your adb client and adb process on the device.
The adb server runs on port 5037 (by default) and listens for commands that you issue via your adb client. As stated in the docs, the server then sets up connections to all running devices. It locates emulators by scanning odd-numbered ports in the range 5555 to 5585, the range used by the first 16 emulators. Where the server finds an adb daemon (adbd), it sets up a connection to that port.
Now, let’s talk about the error :
couldn’t find device interface
It came after running adb devices
.
Looking at the full output, I noticed that it’s coming from the usb_osx.cpp file located here. It says that it can’t open the usb port.
Restarting the adb server or my mac didn’t help.
After searching around a bit, I found the most probable reason - maybe another process was occupying that port. That was mostly it, I realised that it was done by another tethering app that I was using.
After uninstalling that app, finally I was able to see my device in adb devices
.
Hope it helps people out there.
Feel free to reach out in case of any doubts.
Comments
Post a Comment