I'm using termux in Android
I connect my using tcpip
I can't excute command reason show multiple devices connected
adb devices
List of devices attached
emulator-5554 device
adb allows multiple devices to be connected which will not allow to run the shell
you can try restarting the server using the following command and try again
adb kill-server
adb start-server
it worked for me some one already mentioned about the -s Serial number ( phone / emulator id )
adb -s SERIAL shell
so that will also be a good option to try
you can also try command line to connect with the target using
adb connect xxx.xxx.xxx.xxx:port
you may also try
adb disconnect
and retry
Good luck
Related
I genymotion emulator and my phone connected , I want to run and debug my application over wifi , I found the instruction to do so but I get this error when I enter this code :
adb tcpip 5555
I get this error :
error: more than one device/emulator
How can I make my device as default or something like that to solve this problem ?
You can send commands to a specific device, according to docs:
$ adb devices
List of devices attached
emulator-5554 device
emulator-5555 device
$ adb -s emulator-5555 do_your_command
Also, if only one is emulator or a real device you can just attach -e or -d and send the command to it:
If you have multiple devices available, but only one is an emulator, use the -e option to send commands to the emulator. Likewise, if there are multiple devices but only one hardware device attached, use the -d option to send commands to the hardware device.
Do following thing which will help you,
You getting the message just because you are connected more than one device.
Run commands
adb devices
after the fire above command, you get the list of the device, From the list select your device id which not emulator
and fire following command
adb -s f725aa8b7ce4(deviceId) tcpip 5555
and after this fire
adb connect yourIp 5555
I was struggling with same issue since months, later while testing in postman I got know that "Appium inspector" is the main reason for this issue. As it creates new session Id and interrupt the running framework server.
Hence, adb kill-server adb start-server resolves the issue as it actually kill the session ID created by Appium inspector and starts new server.
I have an LG watch which I can connect directly to my developer machine using USB and therefore can use the following command to take screenshots:
adb shell screencap -p /sdcard/screenshot.png
However my Moto 360 watch doesn't have a usb connection and thus I have to connect it using bluetooth going via its paired handset. This means there are always two devices connected to adb. Thus its not possible to use the adb shell command as adb doesn't know which device to apply it to. Some adb commands can have the device specied, but it doesn't look like this is possible with adb shell.
Using the Take wearables screenshot menu option in the Android Wear app isn't doing anything - it says "Screenshot request sent" but then nothing after that.
So how can I grab a screenshot of the watch? (I want to take a screenshot when there is an incoming phone call)
Enable bluetooth debugging on your wearable and setup a debugging session (described here: Debugging over Bluetooth).
You have to run any adb command in the following format:
adb -s localhost:4444 <command>
A simple
adb -s localhost:4444 shell screencap -p /sdcard/screenshot.png
adb -s localhost:4444 pull -p /sdcard/screenshot.png
should do the trick ;)
I have connected an android device over tcpip using adb connect <ipaddress>. I am able perfrom all operations of adb on this devices.
However when I issues a command adb -s <ip>:5555 reboot, I see that prompt simply hangs and reboot is not being performed on the devices.
Is this a known limitation of adb over tcpip?
Are there any other ways to issue reboot commands in such cases?
Thanks in advance
Command adb -s :5555 reboot is incorrect, adb -s <IP Address>:<5555> reboot is correct.
If your device IP is 172.16.7.123, use the following.
$ adb connect 172.16.7.123
Lets say your list of devices show the following
$ adb devices
List of devices attached
172.16.7.123:5555 device
0554e0700a67240d device
The correct way to reboot the device using adb is
$ adb -s 172.16.7.123:5555 reboot
After issuing the above command, your prompt will hang since the adbd daemon is killed on the device.
To return it to normal, use adb disconnect 172.16.7.123 on another prompt and it will return to normal.
I need remote ADB shell..
I know that we have to issue "ADB tcpip ".. to change ADB server to TCP listening mode.
But, the problem is that my phone is not rooted, and I do not have USB cable.
I can't issue tcpip command since I do not have USB cable,,
I can't change default.prop file as the phone is not rooted.
Is there any other ways to change ADB server to TCP listening mode???
I found an articel that says you can execute setprop persist.adb.tcp.port 5555 to make tcpip mode autostart after reboot.
The problem is, you must run this command as root.
On my device unfortunally the command su doeas not exist.
Here is the orginal Permanent network debugging on android
EDIT: I discovered, that the su command is only available when your device is rooted.
So the solution only works when you have a rooted phone
The simple answer is: no, you can't.
As you said, you can't access the prop file and don't have a cable to change with ADB. The only way is you find the port via an Android terminal emulator (a.k.a Termux)
For anyone looking for a better answer:
YES, YOU CAN!!
When you try to execute "adb tcpip 5555" without an USB cable, it returns:
"error: no devices/emulators found"
Emulators?? After googling I found the way and made a batch file that connects my device directly through WIFI, no cables needed at all:
set /p ip= Device IP:
:CONNECT
if "%CD%"=="C:\" goto ROOT
cd ..
goto CONNECT
:ROOT
cd ...Android\Sdk\emulator
echo.
echo Starting emulator...
start /MIN emulator -avd Nexus_5X_API_29_x86 -no-window
(you can check other avaliable devices with "emulator -list-avds")
cd ..
cd platform-tools
adb wait-for-device
echo.
echo Emulator started.
echo Connecting with device...
adb tcpip 5555
adb connect %ip%
echo.
echo Closing emulator...
(you need it just to be able to execute "adb tcpip 5555")
adb -s emulator-5554 emu kill
(you can check the name with "adb devices")
To enable wireless debug need to configure the ADB command. (in mac os)
Step1:- First of all need to enable adb command. (check SDK tool and install command-line tools)
Step2:- connect the device with a USB cable after that run the below command.
command: adb devices
the above command will show a list of connected mobiles.
Step3:- after that, we need to configure TCPIP protocol:
e.g : adb tcpip 5556
Step4:- Run command to connect the device.
command: adb connect your_ip:port_address
eg:- adb connect 192.168.1.152:5556
If you are using the stock android os system, then you can enable remote debugging in Settting -> developer options.
I have more than one android emulator running, along with devices connected to the same machine.
I want to to know how to connect to a single emulator/device from the command prompt.
For example: adb shell emulator-5554
But that doesn't work.
You should use -s switch:
adb -s emulator-5554 shell
with the command
adb devices
you get a list of all connected devices like:
$ adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
emulator-5558 device
Then you can run all commands normally, but you have to attach the -s option
e.g.
adb -s emulator-5556 install helloWorld.apk
Take a look at the tutorial if you want to know more about adb.
adb connect xx.xx.xx.xx
adb disconnect xx.xx.xx.xx
it can be X86 Emulators ;)
http://blog.gokifu.com/2011/05/android-x86-faster-emulator/