天道酬勤,学无止境

android emulator renaming from emulator-5554 to a unique string

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?

评论

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.

You can't change the adb generated name, but you can change the port number. You need to start the emulator with command line.

Go to emulator directory: ... \Android\Sdk\emulator

Use this command.

./emulator –port <port number> -avd "emulator name" <options> 

For example:

./emulator –port 5558 -avd MyEMU

In adb devices your device is now emulator-5558.

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • android emulator in ADT plugin not running
    I'm using Eclipse ADT plugin for android development. I came across some problems and I remove all my existing emulators and create a new one. when I run an android project and start the emulator, it just pop up and freezes with a black screen even before it start Android os. and the progress tab shows,No operations to display at this time. and the logcat displaying I/ServiceManager(270): Waiting for service SurfaceFlinger... over and over again. And the console shows [2013-12-02 14:54:03 - Emulator] emulator: warning: opening audio input failed [2013-12-02 14:54:03 - Emulator] [2013-12-02 14
  • ADT插件中的android模拟器未运行(android emulator in ADT plugin not running)
    问题 我正在使用Eclipse ADT插件进行Android开发。 我遇到了一些问题,删除了所有现有的模拟器并创建了一个新的模拟器。 当我运行一个android项目并启动模拟器时,它甚至在启动Android操作系统之前就弹出并冻结了黑屏。 并且进度选项卡显示,此时No operations to display at this time.显示No operations to display at this time. 和显示logcat的I/ServiceManager(270): Waiting for service SurfaceFlinger...一遍又一遍。 控制台显示 [2013-12-02 14:54:03 - Emulator] emulator: warning: opening audio input failed [2013-12-02 14:54:03 - Emulator] [2013-12-02 14:54:04 - AndroidV4Virtusel] New emulator found: emulator-5554 [2013-12-02 14:54:04 - AndroidV4Virtusel] Waiting for HOME ('android.process.acore') to be launched... 但是仿真器从未启动。
  • 使用android模拟器发送和接收文本(Sending and receiving text using android emulator [closed])
    问题 关门了。 这个问题需要更加集中。 它当前不接受答案。 想改善这个问题吗? 更新问题,使其仅通过编辑此帖子即可将重点放在一个问题上。 7年前关闭。 改善这个问题 我目前正在开发包含文本消息的android应用程序。 是否可以仅使用android模拟器来发送和接收短信? 如果是,我该怎么办? 回答1 这很容易: 打开控制台通过telnet连接到正在运行的仿真器: telnet localhost 5554 (您可以在仿真器标题中找到端口号) 输入以下内容: sms send senderPhoneNumber textmessage 回答2 您也可以使用两个仿真器。 同时打开两个仿真器。 它们将被命名为emulator-5554和emulator-5556 。 然后从一个设备输入文本(555)521-555x,其中后4位是仿真器名称中的数字。 这样您就可以在两个设备之间发送短信。 回答3 如果使用Eclipse,则非常简单。 1 1)转到DDMS。 2)在此处,左窗格将包含活动的仿真器列表,选择您的仿真器,然后在右窗格中,您将获得仿真器控制->电话操作->传入号码,消息。 输入这些,然后点击发送。 3)在模拟器中,您将收到消息。 干杯:) 回答4 如果您在Windows上工作:1.通过在命令提示符下输入以下内容来安装telnet客户端 pkgmgr /iu
  • 使用Android模拟器进行远程调试(Remote debugging with Android emulator)
    问题 是否可以在一台计算机上编写代码/编译Android应用程序,并在另一台计算机上启动的模拟器上进行远程调试? 我对模拟器经常吃掉笔记本电脑一半的CPU感到厌倦。 回答1 我以前没有尝试过(甚至没有注意到)cmb提到的adb connect命令,但是我可以确认自己转发TCP端口(例如通过SSH)可以正常工作。 仿真器每个实例侦听两个TCP端口:5554用于telnet接口,5555用于与DDMS之类的工具进行控制通信。 因此,您可能只使用转发端口5555就可以了(尽管到目前为止,我都只尝试了5555)。 随后的每个仿真器都将使用下一个可用的偶数+奇数端口号元组(我认为最多为5580)。 作为参考,我在本地计算机上执行了以下步骤: ssh -NL 5554:localhost:5554 -L 5555:localhost:5555 myuser@remote-server killall adb; adb devices 我相信模拟器会在启动时尝试通知本地adb服务器。 因此,需要重新启动adb才能探查本地5554+端口。 请注意,ssh命令中的localhost是指远程计算机的本地接口。 adb devices显示了一个新的模拟器emulator-5554 ,我可以像在本地计算机上运行它一样使用它。 回答2 这是我在Windows上解决问题的方法。 我几乎追随克里斯托弗
  • HelloAndroid] emulator-5554已断开连接! 取消“ com.example.helloandroid.HelloAndroid活动启动”!(HelloAndroid]emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!)
    问题 我是Android新手。 通过使用Eclipse遵循HelloAndroid教程。 运行HelloAndroid之后,AVD'xian_avd2'午餐了,但是到此为止,AVD上没有显示“ Hello,Android”。 好像正在等待HOME('android.process.acore')启动... 不知道该如何解决,请帮忙。 谢谢wang813 [2010-01-29 00:12:13 - HelloAndroid]------------------------------ [2010-01-29 00:12:13 - HelloAndroid]Android Launch! [2010-01-29 00:12:13 - HelloAndroid]adb is running normally. [2010-01-29 00:12:13 - HelloAndroid]Performing com.example.helloandroid.HelloAndroid activity launch [2010-01-29 00:12:13 - HelloAndroid]Automatic Target Mode: Preferred AVD 'xian_avd2' is not available. Launching new emulator. [2010-01-29 00
  • 为什么会收到模拟器-5554断开连接的消息(Why do I get a emulator-5554 disconnected message)
    问题 当我启动我的android模拟器时,它会花费一些时间,然后它将显示emulator-5554断开连接的消息。 谁能告诉我问题是什么? 回答1 在Eclipse IDE中打开Android的“设备”视图。 然后在设备菜单上单击“重置Adb”菜单项。 然后再次运行您的应用程序。 回答2 我按照以下步骤解决了这个问题, 运行模拟器保留仿真器,(无论发生相同的错误) 确保出现仿真器主屏幕转到窗口->显示透视图-> DDMS->在设备面板中->在角落下拉菜单上重置adb 希望对您有帮助。 回答3 重新启动模拟器 Select & Right Click on Android Project Run Configurations Go to tab Target Enable option Wipe User Data on Emulator launch parameters Run Application 如果使用其他IDE,则可以使用-wipe-data标志重新启动仿真器,以删除该仿真器在先前运行中创建的所有临时文件。 回答4 请注意,要找到“重置adb”选项,您必须单击设备视图右侧摄像机旁边的向下箭头。 箭头可能与设备工具栏上的所有其他内容一样显示为灰色。 有时候,由于不断断开连接,有时需要数小时才能成功启动模拟器,直到我发现此选项及其被埋在哪里。 回答5 我今天遇到了同样的情况
  • Test run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
    This is my first time setting up an Android test project to test a Android project. I've created a very basic test case which I'm trying to get to run, however what I have does not run. I get a Test run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'. I would troubleshot this more, however I don't get any more information, such as which class it is trying to find, etc. Any ideas on how to get more information from the error? Any common areas I should look at, or anything that might need to be configured that I'm overlooking? Below is the information from the
  • 错误:“无法在设备'emulator-5554'上安装APK:超时”(Error: “Failed to install apk on device 'emulator-5554': timeout”)
    问题 我已经使用模拟器运行了我的应用程序。 上传需要大约5分钟的时间,而在模拟器上安装我的应用程序则需要2分钟。 两分钟后,它失败了。 这是错误控制台, [2013-03-28 14:13:18 - newwaterreadingapp] ------------------------------ [2013-03-28 14:13:18 - newwaterreadingapp] Android Launch! [2013-03-28 14:13:18 - newwaterreadingapp] adb is running normally. [2013-03-28 14:13:18 - newwaterreadingapp] Performing com.example.newwaterreadingapp.MainActivity activity launch [2013-03-28 14:13:18 - newwaterreadingapp] Automatic Target Mode: using existing emulator 'emulator-5556' running compatible AVD 'NewAvd_water_electricity_reading' [2013-03-28 14:13:18 - newwaterreadingapp]
  • 如何在Android中以编程方式解锁屏幕?(How can I unlock the screen programmatically in Android?)
    问题 我正在开发一个基于JUnit的Android远程自动化测试框架(测试在android外部运行,并与其中的代码进行交互)。 一切正常,但是我遇到的一个问题是,当我自动启动一个新的模拟器时,屏幕开始锁定。 这似乎影响了我的测试能否运行,此外,我还想观看测试的运行情况(单击按钮,键入文字等)。 如果我手动启动模拟器并解锁其屏幕,则一切正常。 有没有办法在Android中以编程方式解锁屏幕? Java API,命令行或shell命令等都可以。 除此以外,也许有一种方法可以启动解锁的模拟器? 回答1 您可以通过模拟器的控制台界面与其进行交互。 如果您想知道仿真器为什么以5554之类的数字开头-那是因为它是仿真器监听的端口。 您可以使用adb devices命令找到用于运行仿真器的端口。 它将具有以下输出: C:\>adb devices List of devices attached emulator-5554 device 因此,您可以使用以下命令连接到仿真器: telnet localhost 5554 如果连接成功,将出现一个OK提示,您可以开始输入命令。 有各种各样的命令,但我们感兴趣的一个event来模拟硬件事件。 我们可以通过按以下命令模拟的菜单来解锁屏幕: event send EV_KEY:KEY_MENU:1 EV_KEY:KEY_MENU:0 EV_KEY:KEY
  • Error with Android Studio: Cannot launch AVD in emulator
    The ERROR: resizing partition e2fsck failed with exit code 1. I have made sure that I follow this video exactly when setting up my AVD. Whenever I run the AVD with the x86_64 System Image, I get the following message: Cannot launch AVD in emulator. Output: Creating filesystem with parameters: Size: 69206016 Block size: 4096 Blocks per group: 32768 ERROR: resizing partition e2fsck failed with exit code 1 Inodes per group: 4224 Inode size: 256 Journal blocks: 1024 Label: Blocks: 16896 Block groups: 1 Reserved block group size: 7 Created filesystem with 11/4224 inodes and 1302/16896 blocks Hax is
  • HelloAndroid]emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
    I am new to Android. Follow the HelloAndroid Tutorials by use Eclipse. After run HelloAndroid, the AVD 'xian_avd2' lunched, but stop there, no " Hello, Android" displayed on AVD. Looks like Waiting for HOME ('android.process.acore') to be launched... Not know how to resolve this, please help. Thanks wang813 [2010-01-29 00:12:13 - HelloAndroid]------------------------------ [2010-01-29 00:12:13 - HelloAndroid]Android Launch! [2010-01-29 00:12:13 - HelloAndroid]adb is running normally. [2010-01-29 00:12:13 - HelloAndroid]Performing com.example.helloandroid.HelloAndroid activity launch [2010-01
  • failure of adb to copy .apk file to the Android Emulator: no such file or directory
    I'm hitting a snag in getting the MyFirstApp (Hello World) Android app to work in the emulator. I am following the instructions at: http://developer.android.com/training/basics/firstapp/running-app.html Windows7-64 / Eclipse The app works via USB to my phone. Steps taken: Make sure my PATH environment variable includes the Android SDK. OK. Launch C:/Users/(me)/AppData/Local/Androd/android-sdk/platform-tools/adb.exe. OK. Start the emulator from Eclipse. OK, it comes up. Verify that MyFirstApp.apk is present in the Eclipse workspace MyFirstApp/bin directory. Run the MyFirstApp application from
  • Samsung Galaxy Note III emulator settings
    I am porting my iPhone app over to android and the client uses Samsung Galaxy Note III. I need to create an emulator to help with the debugging, but I am getting problems in starting the emulator with the settings I got from gsmarena. There are similar posts but they are of Samsung Galaxy Note II and also used old AVD. What should be selected in AVD (Device and Target)? I also did some changes and my final settings came up to be: Emulator AVD- Device: 1080 x 1920:xhdpi Target: Google API's(Google Inc.) - API Level 17 RAM: 256 VM Heap: 48 Internal Storage: 1 GB SD Card Size: 1024 MB With the
  • Failed to install *.apk on device 'emulator-5554': EOF
    The project I tried to run is set to minSDK level 7. I have gotten the above error message when running Android virtual device-5554(the other devices work well). It is working so slowly, and taking too much time to get home screen not even run. At the end, it gives this error : Failed to install *.apk on device 'emulator-5554': EOF I restarted my computer and Eclipse several times, as well as clean projects. I also tried this Why is the Android emulator so slow? How can we speed up the Android emulator? to get it fixed. Yesterday, it was working pretty well. Now it is so sluggish. Any
  • Android emulator - unable to load driver
    Running on Ubuntu, I'm getting this error: Cannot launch AVD in emulator. Output: libGL error: unable to load driver: i965_dri.so libGL error: driver pointer missing libGL error: failed to load driver: i965 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 55 Current serial number in output stream: 54 Platform-tools is the latest. Emulator image uses https://dl.google.com/android
  • 尝试运行android应用程序时,模拟器屏幕挂起(Emulator screen hangs when trying to run android application)
    问题 我正在尝试过去两天,但找不到任何解决方案。尝试在错误日志中运行带有错误消息的android应用程序时,我的模拟器屏幕挂起,如下所示: No command output when running: 'am start -n com.ss.hello/com.ss.hello.MainActivity -a android.intent.action.MAIN -c 异常堆栈跟踪: com.android.ddmlib.ShellCommandUnresponsiveException at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408) at com.android.ddmlib.Device.executeShellCommand(Device.java:435) at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:67) at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction
  • 在Android中连接2个模拟器实例(Connecting 2 Emulator instances In Android)
    问题 我想在2个仿真器中创建一个服务器和一个客户端来写入和读取数据。 我为服务器编写代码: public class ServerActivity extends Activity { /** Called when the activity is first created. */ private ServerSocket serverSocket = null; private TextView tv; public static final int SERVERPORT = 4444; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv= (TextView) findViewById(R.id.myTextView); try { Connect(); } catch (IOException e) { // TODO Auto-generated catch block tv.setText("Not connected"); e.printStackTrace(); } } public void Connect() throws IOException {
  • Emulator screen hangs when trying to run android application
    I am trying for last 2 days but can not find any solution.My emulator screen hangs when trying to run android application with error message in error log as below: No command output when running: 'am start -n com.ss.hello/com.ss.hello.MainActivity -a android.intent.action.MAIN -c Exception stack trace: com.android.ddmlib.ShellCommandUnresponsiveException at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408) at com.android.ddmlib.Device.executeShellCommand(Device.java:435) at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction
  • Android Failed to install HelloWorld.apk on device (null) Error
    I am new to Android. When I am running my android application in eclipse I am getting these messages in the console: [2011-03-08 12:57:35 - HelloWorld] ------------------------------ [2011-03-08 12:57:35 - HelloWorld] Android Launch! [2011-03-08 12:57:35 - HelloWorld] adb is running normally. [2011-03-08 12:57:35 - HelloWorld] Performing com.oreilly.helloworld.HelloWorldActivity activity launch [2011-03-08 12:57:35 - HelloWorld] Automatic Target Mode: Preferred AVD 'MY_AVD' is not available. Launching new emulator. [2011-03-08 12:57:35 - HelloWorld] Launching a new emulator with Virtual Device
  • 错误:无法访问包管理器。 系统正在运行吗? -在Android Studio中(Error: Could not access the Package Manager. Is the system running? - At Android Studio)
    问题 我安装了android studio并尝试运行简单的项目。 但是我发现了奇怪的错误消息: Waiting for device. /usr/local/idea/android-studio/sdk/tools/emulator -avd Nexus-4-18-xhdpi -netspeed full -netdelay none emulator: emulator window was out of view and was recentered Device connected: emulator-5554 Device is online: emulator-5554 Target device: Nexus-4-18-xhdpi [emulator-5554] Uploading file local path: /home/nazar/Documents/coursera-android/Examples/HelloAndroid/out/production/HelloAndroid/HelloAndroid.apk remote path: /data/local/tmp/course.examples.HelloWorld.HelloWorld Installing course.examples.HelloWorld.HelloWorld DEVICE