Search code examples
androidcommand-lineadbemulationdevice

How to identify an android emulator (AVD) using ADB


I use the emulator AVD and i have 3 android :

  • First name Android : test
  • Second name Android : test1
  • Third name Android : test2

I launch the first and second android with command line :

emulator -avd test
emulator -avd test1

And after, when i use this command line :

avd devices

I have

List of devices attached
emulator-5556 device
emulator-5554 device

How i can identify my android emulator with adb (only command line)?
If it's impossible, how I can know if my device is started with "emulator" (only command line) ?


Solution

  • Try doing a TELNET to the AVD

    emulator -avd test
    emulator -avd test1
    
    avd devices
    
    List of devices attached 
    emulator-5556 device 
    emulator-5554 device
    
    telnet localhost 5554
    Trying 127.0.0.1...
    Connected to localhost.
    ...
    OK
    avd name
    test1