Home > Tips and Tricks

Execute ADB Commands when multiple devices are connected

In this guide, we will show you a nifty method to execute ADB Commands to a single device when multiple devices are connected. If you across this post, then the first query that would come to your mind is why would anyone carry out this task in the first place. Well, initially I also had the exact same query until I manually came across this situation.

During the early days of my YouTube channel, I used to do recording via an app installed on my phone that required you to enable USB Debugging. And for the unaware, all my videos are on rooting and flashing related stuff, so I already had a device connected to my PC. Henceforth, whenever I executed the adb devices commands, my PC identified two connected devices.

Henceforth I was skeptical to execute the required command because it also end up affecting the device on which I didn’t intend to [which was my recording device]. So I did some further research and found out that there did exist a method through which you could execute ADB Commands specifically at a single phone when multiple devices are connected. And in this guide, we will show you how to do just that. Follow along.

How to Execute ADB Commands when Multiple Devices are Connected

ADB Commands when multiple devices are connected

  1. First off, download and extract Android SDK Platform Tools on your PC.
  2. Then enable USB Debugging on one of your devices and connect it to PC.
    ADB Commands when multiple devices are connected
  3. Now type in CMD in the address bar of platform tools and hit Enter.
  4. It will launch Command Prompt. Now execute the below command.
    adb devices
  5. It will give you a serial ID, note it down somewhere along with the device name.
  6. Then connect your second device to your PC as well and again execute the same command.
    ADB Commands when multiple devices are connected
  7. You will again get a serial ID, note it down somewhere along with the device name.
  8. So from now onwards, we will be using the serial ID to execute the desired ADB Command.
  9. The general syntax for the same is as follows [make sure to replace serial ID and command according to your need]:
    adb -s serial_ID command
  10. Let’s understand this with the help of a few commands. In my case, 6ddfaeb8 is for Poco F4 [much] whereas c07c4a1a is for OnePlus 7T

ADB Shell Commands when Two Devices are Connected

  1. In case of my Poco F4 [munch], it will be
    adb -s 6ddfaeb8 shell

    ADB Commands when multiple devices are connected

  2. For OnePlus 7T, it will be:
    adb -s c07c4a1a shell

    ADB Commands when multiple devices are connected

Fastboot Commands when Two Devices are Connected

  1. For instance, if I want to boot Poco F4 to Fastboot Mode, then the command will be
    adb -s 6ddfaeb8 reboot bootloader
  2. To verify the same, type in the below command and you’ll get the same serial ID as above [which in my case is 6ddfaeb8].
    fastboot devices

    ADB Commands when multiple devices are connected

Reboot to Recovery When Two Devices are Connected

  1. For example, if I want to boot my OnePlus 7T to Recovery Mode, then the command will be:
    adb -s c07c4a1a reboot recovery

    ADB Commands when multiple devices are connected

That’s it. These were the steps to execute ADB Commands to a single device when multiple devices are connected. We have also listed a few commands to make it easier to understand this slightly complex topic. With that said, if you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: