Android ghost device emulator-5554 offline, adb, emulator

Problems encountered:

There is an emulator-5554 setting in adb devices, which causes more than one devices errors to be encountered when executing commands when an Android device is inserted.

Troubleshooting process:

I searched on stackoverflow, first tried to close all the simulators, and restarted many times, but it still didn't work, and the simulator was ruled out. So according to the program found on the Internet to find port 5555, netstate and lsof filter port 5555, locate the pid, and finally check the pid in htop, and found that it was caused by a plug-in I installed before. On my mac, the tabnine plug-in occupies port 5555 by default, causing adb to think it is an emulator and has been trying to link.
Find a document Android experience: port 5555 will be mistaken for emulator by adb - take a look

  • When adb starts, connect to port 5555
  • Why is the connection called emulator-5554 instead of emulator-5555?
    This is because the console port of the default emulator is 5554 (it should be possible to interact with the emulator with a telnet connection (not yet tested)), and the port of adb is the console port + 1 is 5555

Later, I went to tabbnie's github and looked at it. It turned out that someone had encountered this problem before.

Why bind port on 5555 · Issue #422 · codota/TabNine · GitHub  (Why bind port on 5555), tabbnie also provides an interface to modify the port, Under tabnine_config.json, set tabnine_hub_port

solution:

Modify the default port of tabnine_hub_port in the configuration file tabnine_config.json of tabbnie, for example 4555. If you can't find tabnine_config, search for it.

reboot, tabnine 

Guess you like

Origin blog.csdn.net/djkk1230/article/details/128233335