android emulator renaming from emulator-5554 to a unique string

ε祈祈猫儿з 提交于 2019-12-13 08:07:24

问题


So when on starting up an emulator , adb devices give me

emulator-5554 device

All dandy till here.

What i am envisioning is to create an emulator farm with multiple emulators spawned up on multiple devices. In order to uniquely differentiate from an emulator-5554 running on machine A from emulator-5554 running on machine B ,I would like to rename emulator-5554(s) to something like machineA-emulator-5554 and machineB-emulator-5554. Searching around did not find me much help ( as a majority of the questions were regarding actual device renaming). Any pointers on the above?

NP:I had tried to do a setprop on serialno with a random string and then checked to see whether it actually changed ( and it had)

root@generic_x86:/ # getprop persist.usb.serialno

76876987gg

Weirdly running adb devices gave me a status of

emulator-5554 offline

The emulator name did not change and the status went offline. Am i missing something here?


回答1:


adb server scans range of TCP ports and when it finds something listening on those ports it registers it as a device with the emulator-XXXX name. No configuration of the device itself can change that. You could either modify the adb code to implement your custom naming scheme or just use some other facility to identify your emulator instances.



来源:https://stackoverflow.com/questions/42536231/android-emulator-renaming-from-emulator-5554-to-a-unique-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!