👋 ADB - Say bye to “more than one device/emulator” error

theapache64
Jun 19, 2023

--

🥵 Problem

If you have multiple Android devices connected and forget to specify the device’s serial number in the adb command, you will receive an error like this.

 ❯ adb shell getprop ro.product.manufacturer # sample command
adb: more than one device/emulator

To resolve this issue, you need to find the serial number of the device and then execute the command again. However, this process can be time-consuming. 😩

❯ adb devices
List of devices attached
14011JEC203443 device
UO5L9PLVSSFQIBZL device
❯ adb -s 14011JEC203443 shell getprop ro.product.manufacturer
Google

💡 A better solution

Requirements

Add this to your ~/.zshrc and you’ll get a device chooser automatically 😍

📹 Demo

📝 Credits

Thanks to Ben Kadel for enlightening me about the viability of using fzf

--

--