$ adb --help-s SERIAL usage gadget via provided serial (overrides $ANDROID_SERIAL)$ adb devicesList of gadgets attached emulator-5554 device7f1c864e device$ adb shell -s 7f1c864eerror: more than one gadget and emulator
*

*

Use the -s option BEFORE the command to specify the gadget, for example:

adb -s 7f1c864e shellSee also http://developer.android.com/tools/help/adb.html#directingcommands


*

*

adb -d shell (or adb -e shell).

You are watching: Error: more than one device/emulator

This command also will certainly help you in most of the cases, if you are as well lazy to kind the full ID.

From http://developer.android.com/tools/help/adb.html#commandsummary:

-d - Direct an adb command also to the just attached USB device. Returns an error when even more than one USB gadget is attached.

-e - Direct an adb command also to the only running emulator. Returns an error once even more than one emulator is running.


*

Another different would certainly be to collection atmosphere variable ANDROID_SERIAL to the relevant serial, below assuming you are utilizing Windows:

collection ANDROID_SERIAL=7f1c864eecho %ANDROID_SERIAL%"7f1c864e"Then you have the right to use adb.exe shell without any problems.


I discovered this question after seeing the "even more than one device" error, through 2 offline phones showing:

C:Program Files (x86)Androidandroid-sdkandroid-tools>adb devicesList of tools attachedSH436WM01785 offlineSH436WM01785 offlineSH436WM01785 sideloadIf you just have one gadget associated, run the adhering to commands to remove the offline connections:

adb kill-serveradb tools
To install an apk on among your emulators:

First acquire the list of devices:

-> adb devicesList of gadgets attached25sdfsfb3801745eg deviceemulator-0954 deviceThen install the apk on your emulator via the -s flag:

-> adb -s "25sdfsfb3801745eg" install "C:Usersjoel.joelDownloads elease.apk"Performing Streamed InstallSuccessPs.: the order here matters, so -s hregarding come prior to install command, otherwise it will not work.

Hope this helps someone!


This gist will certainly execute the majority of of the occupational for you showing a menu when tbelow are multiple tools connected:

$ adb $(android-select-device) shell1) 02783201431feeee device 3) emulator-55542) 3832380FA5F30000 tool 4) emulator-5556Select the device to usage, to quit:To avoid typing you deserve to simply create an alias that contained the device selection as defined right here.


janot has currently mentioned this over, but this took me some time to filter the finest solution.

Tbelow are two Broad usage cases:1) 2 hardware are linked, first is emulator and also other is a Device.Solution : adb -e shell....whatever-command also for emulator and also adb -d shell....whatever-command for device.

2) n number of tools are connected (all emulators or Phones/Tablets) via USB/ADB-WiFi:Solution: Step1) run adb devices THis will offer you list of devices currently linked (via USB or ADBoverWiFI)Step2) now run adb -s shell....whatever-commandno matter how many kind of devices you have.

Example to clear application information on a device associated on wifi ADB I would certainly execute:adb -s 172.16.34.89:5555 shell pm clear com.package-id

to clear application information connected on my usb linked tool I would certainly execute:adb -s 5210d21be2a5643d shell pm clear com.package-id


Share
Improve this answer
Follow
answered Sep 7 "18 at 7:28
sud007sud007
4,51733 gold badges5050 silver badges5656 bronze badges
Add a comment |
5
The ideal way to run shell on any specific device is to use:

adb -s > shellFor Example:adb -s emulator-5554 shell
Share
Improve this answer
Follow
edited Oct 4 "20 at 21:01
Theblockbuster1
16922 silver badges1313 bronze badges
answered Jun 27 "19 at 10:28
Shivam BharadwajShivam Bharadwaj
1,2181515 silver badges1717 bronze badges
Add a comment |
4
For Windows, here"s a quick 1 liner example of exactly how to install a file..on multiple devices

FOR /F "skip=1" %x IN ("adb devices") DO begin adb -s %x install -r myandroidapplication.apkIf you setup on including this in a batch file, relocation %x via %%x, as below

FOR /F "skip=1" %%x IN ("adb devices") DO begin adb -s %%x install -r myandroidapp.apk
Share
Improve this answer
Follow
answered Mar 14 "18 at 19:19
zinghzingh
37222 silver badges1111 bronze badges
1
Add a comment |
3
Running adb regulates on all associated devices

Create a bash (adb+)

adb devices | while read linedoif < ! "$line" = "" > && < `echo $line | awk "print $2"` = "device" >then device=`echo $line | awk "print $1"` echo "$device $
..." adb -s $gadget $
fidoneuse it with

adb+ //+ command


Share
Improve this answer
Follow
edited May 23 "17 at 11:47
Community♦
111 silver badge
answered Apr 3 "15 at 11:11
Shivaraj PatilShivaraj Patil
7,84644 gold badges2727 silver badges5454 bronze badges
2
Add a comment |
1
Create a Bash (tools.sh) to pick a serial from devices (or emulator):

clear;echo "====================================================================================================";echo " ADB DEVICES";echo "====================================================================================================";echo "";adb_devices=( $(adb tools | grep -v gadgets | grep device | cut -f 1)#$(adb gadgets | grep -v devices | grep gadget | reduced -f 2) );if < $(($#adb_devices<
>)) -eq "1" > && < "$adb_devices<0>" == "#" >then echo "No gadget found"; echo ""; echo "===================================================================================================="; device="" // Call Key Menu attribute fxMenu;else read -p "$( f=0 for dev in "$adb_devices<
>"; do nm="$(echo $dev | reduced -f1 -d#)"; tp="$(echo $dev | reduced -f2 -d#)"; echo " $((++f)). $nm <$tp>"; done echo ""; echo " 0. Quit" echo ""; echo "===================================================================================================="; echo ""; echo " Please select a device: " )" selection error="You think it"s over just because I am dead. It"s not over. The games have simply started."; // Call Validation Numbers fxValidationNumberMenu $#adb_devices<
> $selection "$error" situation "$selection" in 0) // Call Main Menu attribute fxMenu; *) device="$(echo $adb_devices<$((selection-1))> | cut -f1 -d#)"; // Call Key Menu feature fxMenu; esacfiThen in another option deserve to usage adb -s (worldwide choice -s usage device via provided serial number that overrides $ANDROID_SERIAL):

adb -s $device I tested this code on MacOS terminal, yet I think it have the right to be used on home windows throughout Git Bash Terminal.

See more: Where Can I Watch Season 2 Of The 100 Season 2 Episode 1, Watch The 100 Season 2 Episode 2 Online Free

Also remember connumber ecological variables and also Android SDK paths on .bash_profile file:

export ANDROID_HOME="/usr/local/opt/android-sdk/"export PATH="$ANDROID_HOME/platform-tools:$PATH"export PATH="$ANDROID_HOME/tools:$PATH"
Share
Improve this answer
Follow
edited Mar 21 "18 at 19:47
answered Mar 30 "17 at 4:33
equimanequimale
6,83422 gold badges4444 silver badges4545 bronze badges
2
Add a comment |
0
Here"s a shell manuscript I created myself:

#! /bin/shfor gadget in `adb devices | awk "print $1"`; perform if < ! "$device" = "" > && < ! "$device" = "List" > then echo " " echo "adb -s $tool $
" echo "------------------------------------------------------" adb -s $gadget $
fidone
Share
Improve this answer
Follow
answered Oct 2 "19 at 23:38
Francois DermuFrancois Dermu
3,96122 gold badges2020 silver badges1313 bronze badges
Add a comment |
Highly energetic question. Earn 10 reputation (not counting the association bonus) in order to answer this question. The reputation requirement helps defend this question from spam and non-answer activity.

Not the answer you're looking for? Browse various other concerns tagged android shell cmd adb android-debug or ask your own question.


The Overcirculation Blog
Featured on Meta
Linked
104
Is it possible to install APK file if more than one emulators/gadgets are connected
0
Run adb shell on tradition device
0
Unlock multiple android devices through adb
0
Run ADB Covering manuscript as soon as even more than one tool is conncected
28
How to sindicate install apk in gadget in Android Studio
30
Running adb regulates on all connected devices
4
how to read '/data/anr/traces.txt' in samsung S2
1
How to open "adb shell" in context of application being debugged (on non-rooted device)?
1
Unable to install .apk on device
0
How execute I run application on schosen android device?
See even more connected inquiries
Related
1352
Stvariety OutOfMemory worry while loading an image to a Bitmap object
930
Covering command to tar catalog excluding specific files/folders
902
Converting pixels to dp
685
Android error: Faicaused install *.apk on tool *: timeout
241
ADB No Devices Found
112
How to debug in Android Studio utilizing adb over WiFi
12
adb -s 192.168.1.6:5555 ..... error: more than one device/emulator
2
even more than one device/emulator - Error while trying to cast with Genymobile
Hot Network Questions even more hot concerns
Inquiry feed
Subscribe to RSS
Concern feed To subscribe to this RSS feed, copy and paste this URL right into your RSS reader.


lang-sh
Stack Overcirculation
Products
Company kind of
Stack Exadjust Network
website style / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.9.10.40187


Stack Overcirculation works finest via JavaScript allowed
*

Your privacy

By clicking “Accept all cookies”, you agree Stack Exreadjust deserve to keep cookies on your gadget and disclose indevelopment in accordance with our Cookie Policy.