如何从adb设备名称获取Android AVD名称 [英] How to get Android AVD name from adb device name

查看:680
本文介绍了如何从adb设备名称获取Android AVD名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从命令行使用Android SDK,我可以使用以下命令获取可用的运行设备的列表:

Using the Android SDK from the command line, I can get a list of the running devices available using:

./adb device

这给了我可用设备的序列号。如何从该序列号中获得仿真器设备的AVD名称(就像Eclipse ADT插件一样)?

This gives me the serial number of available devices. How can I get the AVD name of the emulator device from that serial number (like the Eclipse ADT plugin does)?

推荐答案

Eclipse插件通过tcp / ip连接到仿真器来完成此任务。要连接(对于Linux),请输入

The Eclipse plugin does it by connecting to the emulator via tcp/ip. To connect, (for linux), type


〜/ code $ telnet localhost 5554

尝试:: 1 ...

正在尝试127.0.0.1 ...

已连接到本地主机。

转义字符为'^]'。

Android控制台:键入帮助以获取命令列表

OK

~/code$ telnet localhost 5554
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK

在键入 adb devices时,将 5554替换为连字符后的任何数字-例如, emulator-5554将打开telnet端口5554。

Replace "5554" with whatever number comes after the hyphen when you type "adb devices" - "emulator-5554", for instance, would have telnet port 5554 open.

然后,键入 avd name,按Enter,您应该会看到类似以下内容的内容:

Then, type "avd name", hit enter, and you should see something similar to the following:


avd name

GB10

OK

avd name
GB10
OK

在此示例中,仿真器的名称为 GB10。

In this example the emulator's name was "GB10".

这篇关于如何从adb设备名称获取Android AVD名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆