简体   繁体   中英

What does the adb command do WITHIN an Android device's shell?

I was connected to my Android device's shell (by doing adb shell in my computer's shell) and without realizing, I typed adb devices . Instead of giving me a command not found error or something, it actually listed one device! The output:

 $ adb devices
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
List of devices attached
emulator-5554   offline

Why does my phone have an adb command, and what is the emulator device?

EDIT: I tried it again and it still works, though now the list of devices it gives is empty. The only difference between when I did it just now and when I did it before is that before, I was doing the bridge wirelessly and now I'm doing it through a wired connection. I know that it's not running the adb command on my computer, because in both cases when I run it on my computer I get a different output.

Some phones do include the adb binary. Some for a specific purpose, others just because the manufacturer was too lazy to edit the default makefile .

Also adb devices listing an offline instance of an "emulator" does not mean that there's an emulator running on the device, just that there is an open tcp port in the range that adb scans when looking for emulator instances. Just ignore it.

Don't worry about emulator.Emulator creates a virtual android device. By using this facility a programmer can test his code on computer without connecting any device. You can read about emulator from https://developer.android.com/training/basics/firstapp/running-app.html#Emulator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM