adb-with-multiple-devices

本文介绍如何使用ADB命令在多个连接的模拟器或物理设备中选择特定目标进行操作,包括使用-d、-e及-sswitch等命令行参数来分别指定物理设备、模拟器或通过序列号指定设备。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载地址:http://www.shockoe.com/adb-with-multiple-devices/

Have you ever had multiple emulators or physical devices or a combination of the two attached at once? It’s frustrating to shut off or unplug your devices in order to single out the one that needs to be targeted. Look no further, adb includes a command line switch to choose the specific device you want to target.

Let’s begin by listing our currently attached devices.

$ adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
HT09PR217646 device

As you can see, we have three devices attached to our system. Two emulators and one physical phone. Now let’s logcat our physical device because it’s running our application that we want to debug. Just pass the -d switch to adb to target our device.

$ adb -d logcat

If we had a single emulator instance and one or more physical devices attached we could pass in the -e switch to adb which targets emulator.

$ adb -e logcat

The final switch we can use for device targeting is the -s switch, which stands for serial number.

$ adb -s emulator-5554 logcat
$ adb -s emulator-5556 logcat
$ adb -s HT09PR217646 logcat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值