I can connect and run one device using adb wireless commands, but how to add more than one device.
on my pc - at command promt.
adb tcpip 5555
adb connect 1.1.1.1
1.1.1.1:5555 device connected
1.1.1.1 is the IP of the device
for more than one device, how to do ?
This question is already answered at https://stackoverflow.com/a/43973839/6791222.
However, you can use "adb -d tcpip 5555" to attach multiple devices.
Related
I can connect to my smartphone with ADB using a usb cable,
I'm also able to connect over tcp/ip to the same smartphone with
adb connect 192.168.1.110 while the usb cable is still connected.
But, as soon as I disconnect the cable, I loose the tcp/ip connection, the device appears to be "offline" (as result to "adb devices" command) and I cannot reconnect over network until I re-connect the cable.
My steps are (this way it works) :
connect the usb cable
adb kill-server
adb tcpip 5555
adb connect 192.168.1.110 (here it connects succesfully!)
disconnect usb cable => I loose network connection to the smartphone
If after step 3 I disconnect the cable, the step 4 doesn't work (port 5555 closed)
It seems like adbd daemon is running ONLY when the cable is connected.
AS my device is not rooted I don't find any way to force adbd daemon to start without connecting the usb cable.
Any idea?
[UPDATE]
I just tried to scan the smartphone for tcp port opened and I found that as soon as I run the command:
adb tcpip 5555
the scanning found the port 5555 opened
but as soon as I disconnect the usb cable, I run again the scan and the port 5555 is found to be closed
This confirm that as soon as I disconnect the usb cable don't know why but adb stop responding on port 5555 or the daemon itself get killed or similar
[UPDATE]
I just did the same steps on another Android device (an asus tablet) and it works perfectly, when I disconnect the cable, the tcp port remain opened, so the issue is not with the steps I'm following but with something else
[UPDATE]
I found other posts with similar issue, this is one of them:
adb connection by wifi getting killed when a new USB attached/detached
, unfortunately I cannot do what he says as my smartphone is not rooted and I'm am in the same situation of comment by Osama in that post
I'm also testing on a Honor phone. I found a solution to solve this problem. You can try to turn on Allow ADB debugging in charge only mode and turn off Always prompt when connecting to USB. It should fix the problem.
Here is the reference for the solution.
Bellow commands allows you always get 5555 as default port number, try this out
Make sure you have wifi configured as "auto connect", also set always allow the adb from net work under developers manul
adb root
adb remount
adb shell setprop persist.service.adb.enable 1
adb shell setprop persist.adb.tcp.port 5555
adb reboot
Hello I can solve problem
First of all connect your device with cable (usb debbuging) click on allow on phone if it asks about debugging
Now open cmd
type cd 'Location of scrcpy'
than type the following
adb tcpip 5555
If it asks you again to do adb tcpip 5555 do it again
adb connect <'device-ip-adress'>
Disconnect the device by removing the cable
scrcpy -s <'device-ip-adress'>
Done! Problem Solved
Firstly connect your device and check if it's connected or not
RUN
adb devices
then
RUN
adb tcpip 5555
now disconnect your device usb cable and go to the settings and find out the IP Address of your phone and RUNn
adb connect your_phone_ip_address
eg. adb connect 192.168.1.102
replace with your own ip and check it with adb devices if it's connected or not
if it's not working then the problem must be something else
You probably don't have The ADB Server running.
With the USB cable connected,
do:
adb kill-server && adb start-server && adb tcpip 5555 && adb connect 192.168.1.110
Once Successfully Connected, You can then Disconnect the Cable.
NOTE: on running adb devices, the device name is now of the format IP:PORT as opposed to the initial Alphanumeric string.
I am trying to sideload a build to my phone, Alcatel Android 7. I have been able to sideload to it before but it's stopped working when I switched to a new network. I am running it from MacOS terminal.
Courtneys-MacBook-Pro-3:~ courtneytaniguchi$ adb connect 10.0.0.216
failed to connect to '10.0.0.216:5555': Connection refused
Courtneys-MacBook-Pro-3:~ courtneytaniguchi$
This phone is developer enabled, I have allowed installation of apps from unknown sources turned on in security, and USB debugging is on too. Yes, I am on the same network.
I had a similar problem failed to connect to '192.168.31.84:5555': Connection refused, final worked by:
kill and restart adb
adb kill-server
adb start-server
makesure USB wired connected
adb devices can see your device id
re-config to tcpip mode: adb tcpip 5555
Note: for multiple USB connected devices, should specify device serial id:
adb -s device_serial_id tcpip 5555
connect to you device via WiFi: adb connect your_android_phone_ip:5555
Full log for your refer:
adb kill-server
adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb devices
List of devices attached
2e2a0cb1 device
orga4pmzee4ts47t device
adb tcpip 5555
error: more than one device/emulator
adb -s 2e2a0cb1 tcpip 5555
restarting in TCP mode port: 5555
adb connect 192.168.31.84:5555
connected to 192.168.31.84:5555
Based on the commands you are entering it seems you are trying to do adb over wifi.
The following may help:
Rebooting the phone
Ensuring the phone is listening over TCP/IP by connecting to it via the USB and entering adb tcpip 5555
Turning USB debugging off and on again
I had the same error. Solved by following extra steps mentioned here which is connecting the device via USB and then executing the following command after finding device id :
./adb -s <device id> tcpip 5555
If you are stuck in the sideloading process, you can always e-mail the .apk file to yourself at an e-mail address which is configured on the phone, download the attachment, then go to 'downloads' app, and click on the .apk file, it should ask if you are sure you want to install the app, just say yes. You have to make sure that you have already selected 'Allow' in the Unknown Sources section in Settings/Development.
Same happened with me. Always rejected, I have two devices used to connect over wifi for some Android Project, im always rejected to 5555 on my Huawei Device. But there is one workaround i know that works.
➜ ~ adb connect 192.168.8.108:5555
failed to connect to '192.168.8.108:5555': Connection refused
➜ ~ adb connect 192.168.8.108:7612
connected to 192.168.8.108:7612
Try port 7612
Thanks!
ADB is installed in the computer, and usb debugging is enabled on devices. Also I have connected one device over wifi successfully. How to connect more devices without having to mention the serial number of the device for every additional device with the -s flag like: adb -s <serial> tcpip <port>
Yes there is a way to do so without having to type the serial number.
Say you have 2 devices A (IP: 192.168.1.32) and B (IP: 192.168.1.33) that you want to connect to ADB over wifi:
Connect device A with a USB cable to the computer (but not B)
adb -d tcpip 5555
adb connect 192.168.1.32
Disconnect device A, and connect device B with a USB cable to the computer
adb -d tcpip 5555
adb connect 192.168.1.33
A slight change in the Abdul Wasae answer, based on my experience .
devices A (IP: 192.168.1.32)
devices B (IP: 192.168.1.33)
Connect device A with a USB cable to the computer (but not B)
adb -d tcpip 5555
adb connect 192.168.1.32
Disconnect device A, and connect device B with a USB cable to the
computer,This time you need to change the port !!
adb -d tcpip 5554
Here you need to specify port as well
adb connect 192.168.1.33:5554
I also have documented this here in more detail
Connecting multiple devices over wifi using adb
I have this problem long time ago so I decided to create this simple bash script.
Assuming that you already added the adb to the path:
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
You just need to follow this steps:
Run this commands: to create your script (typically, you want $HOME/bin for storing your own scripts)
cd ~
mkdir bin
cd bin
touch adb_connect
Open and copy the script using any editor like gedit.
gedit adb_connect
And make your file executable.
sudo chmod +x adb_connect
Modify your path to add the directory where your script is located:
export PATH=$PATH:$HOME/bin
Finally, now connect your device using USB and run the script:
adb_connect
Your device must be connect now, disconnect the USB cable and repeat steps 5 and 6 to add more devices. If a successful connection occurs, it will have this output:
Connecting to LGV498bdcb2c5
restarting in TCP mode port: 7105
connected to 192.168.20.105:7105
How to connect Android device using adb wireless??
As for as adb help says, you just need adb connect, but it seems that's not sufficient as it do not connects device wireless.
Connect yout device with cable
forward abb to tcpip using following command
adb tcpip 5555
disconnect the device
connec to to device wireless using following command
adb connect device_ip:5555
I used to be able to setup wireless ADB no problem (plug in, adb tcpip 5555, adb connect ), now it gets stuck indefinitely during the "adb tcpip 5555" command. Wired adb still works fine, so does setting up wireless ADB through apps in play store, just not via cmd. Between wireless working and now not working, I did a bunch of things so any of them may or may not be the problem:
1) Reformatted computer (Same OS)
2) Redownloaded the SDK needed for Android Development
3) Went from ParanoidAndroid to GPE on my HTC One.
Anyone have any idea what the problem is?
You can emulate what apps do with these steps on your device with root and android terminal emulator:
$ adbd stop
$ setprop service.adb.tcp.port 5555
$ adbd start
Then use adb connect XXX.XXX.XXX.XXX where XXX.XXX.XXX.XXX is your ip address found from:
$ ifconfig wlan0 | awk '/inet addr/ {print $2}' | cut -d: -f2
You can check if your connection is establed using netstat | grep 5555. You should see a tcp entry with your ip address and port for adb connectivity.
If your device is rooted then it is very simple to establish a wireless connection, you don't even need a USB cable. Download this app from Google Play https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=en
It worked for me at least, and as can be seen from the app rating it works for almost all.
-----Enter the command adb kill-server at command prompt-----
C:>adb kill-server
-----Enter the command adb devices-----
C:>adb devices
List of devices attached
daemon not running; starting now at tcp:5037
daemon started successfully
DeviceID device
-----DeviceID is the unique ID of connected device-----
-----Enter the command adb tcpip 5555-----
C:>adb tcpip 5555
restarting in TCP mode port: 5555
-----will see the response as given above -----
-----Enter the command adb connect 1.1.2.2-----
-----1.1.2.2 is the mobile device IP-----
C:>adb connect 1.1.2.2
connected to 1.1.2.2:5555
-----will see the response as given above -----
-----Now u can use 1.1.2.2:5555 ID as wireless to connect device-----