Reputation: 5217
I want to test some things in the emulator by running several in parallel.
now i'm facing the problem that i cant run a command in a emulator, when i dont know how the emulator is called.
when i list my devices using adb devices
, all emulators are called emulator-<port>
, but with that information i cant decide which is the right emulator. I need to change this name on startup and save it in my script, so that further adb commands can use the name to address the right emulator.
So is it possible to change the device name while starting it with the emulator
command?
Some things i tried:
-prop net.hostname=<myhostname>
does not change the adb device name.-ports 1234,1235
on startup allows only one adb logcat to connect via tcp (adb connect localhost:1235 && adb logcat
- the second one with different port will fail)Upvotes: 0
Views: 1777
Reputation: 5217
Found a workaround:
Start the emulator with the -port
argument. In my script i keep track on current used id's and can now send commands to the right emulator.
Upvotes: 2