Debugging an Android App over WiFi. I am using WiFi ADB App to prepare the Android Device for the connection over Wifi. All seems well on that end.
Next, I need to connect adb as follows:
adb connect 192.168.2.8:5555
Sometimes this works properly. But more often, I get the following message:
C:> adb connect 192.168.2.8:5555
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 192.168.2.8:5555
Even though everything seems in order, I have learned that when I see this message, AndroidStudio (version 1.1.0) will not be able to find my AndroidDevice.
I am not the first to run into this, this article suggests a solution. This does not (or nearly never) work for me. However, interesting things do happen.
When opening up Windows TaskManager, I can see one adb.exe (32 bit)
background process. I kill it via End task
button.
Next, I execute the adb connect 192.168.2.8:5555
command in Windows cmd shell. I briefly see two adb.exe (32 bit)
background processes appear in TaskManager. After a second, one process disappears.
In the cmd shell, I get the same stuff about starting on port 5037, which means that -again- AndroidStudio can not find my device.
It looks to me like two adb.exe processes are started up, that one locks port 5555, and that neither process give me a findable connection; not even after one of the processes has been (auto)terminated.
How can I connect adb so that it actually starts on port 5555 and AndroidStudio can actually find my device?
update:
1.) I misunderstood the message:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This means that the daemon is not yet running on the development machine. (I understood this to be the target machine.) You will get this message if you issue adb connect *.*.*.*
without AndroidStudio running (yet). On the development machine, it stars on port 5037.
Then, you get the message:
* daemon started successfully *
connected to 192.168.2.8:5555
It means that it is connected to port 5555 on the target machine (= your Android device).
- It turned out, the above issue was caused by faulty hardware (WiFi adapter). So I was barking up the wrong tree; looking for a software solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…