So I have been following a few tutorials online for setting up android app debugging through wifi, since my USB connection is broken.
The first command line input is giving me problems.
I type in
adb tcpip 5555
and get this message:
Restarting in TCP mode port 5555
This message just hangs and the process never finishes.
I tried different port numbers, same thing. Tried to connect to my device IP and no luck.
Any ideas?
Just plug out your USB wire at that moment and it will connect.
Make sure desktop and device is connected the same network? and
1) Switch on wi-fi
2) adb tcpip 5555 - it restarts your device
3) adb connect deviceIpAddress:5555
4) Unplug your device and run project
Enjoy the life ))))
I have the same problem sometimes, when that happens, use 5556 or other port. that works for me.
When adb tcpip 5556 is not responding, remove your data cable and reconnect cable
adb shell netcfg - for finding phone ip.
adb connect ip:5556 the device will be successfully added.
adb devices - list all devices connected.
I know it's an old thread but it may still help others. My problem solved when I changed my android device usb connection mode from Usb Mass Storage to MTP inside android usb settings.
i had the same issue.
in my case i saw there is two cmd opened,
closed another cmd and its worked for me
Related
I develop on my tablet using android studio.
The tablet is connected to the computer by wifi using
adb connect <ip_andress>:5555
My application contains listeners for USB devices attached/detached.
But unfourtunately, when I connect/disconnect usb device to/from the tablet, the adb connection is getting killed, and I can no longer see the device under "adb devices".
It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.* system properties which on many devices is causing restart of adbd regardless whether it's being used over USB or tcpip.
Do grep "stop adbd" /init*rc to see what I mean.
You could either comment out those stop adbd lines or just disconnect the USB cable before running your adb connect command.
I was never able to connect my cellphone with my computar through wi-fi.
I had already given up. I followed all the instructions and tips, and nothing worked.
Finally, I did what no one said to do.
I've connected the phone to the WiFi network provided by the cable modem itself and not to some (not all) additional networks that are included in the router.
At home I use one of these networks, because I use a Deco Tp-Link router, which propagates the signal to my entire house, but this network is NOT compatible with ADB. It does not identify it as belonging to the same network.
After this, I use the normal procedure described here.
a) Connect cellphone with a USB cable
b) Find the IP_Phone depends on system in the cell phone. Here I use Settings, About Phone, Status and IP address.
c) Run the following adb commands in Command Prompt (Windows) or Terminal (Linux), where IP_Phone is the IP above mentioned. Normally adb.exe is an executable stored in computer path. adb is already included in Android Studio package.
adb tcpip 5555
adb connect IP_Phone
d) Now disconnect USB cable and it's ready. The cellphone model continues to appear in the status line in the top of Android Studio.
-/-
The best wifi is that defined in Cable Modem. It, unlike an any account defined in my router, answers to a ping command.
ping IP_Phone
Disconnect the usb cable just before running adb connect <*ip_address_of_your_phone*>
I'm using Android tablet communicating with a USB device through USB port, the tablet only has one usb port, so I use adb wifi as my debug tool. However, when I connect adb through WIFI, the connection won't keep long(only a few minutes us usually), how to keep the adb wifi connection online all the time?
Another question, is it possible to use USB HUB to connect the tablet with both USB flash-drive and my computer, and keep adb running?
Many thanks!!!
After lots of unsuccessful attempts,I have noticed that turning Allow ADB debugging in charge only mode specification on , solved the problem . It makes the device online and accessable over wifi to ADB.
You can find it under Developer options section.
Here is what I found out from researching everywhere and developing on my own for more than a week.
Q1. adb service often crashes if it is not doing any executions for a long long time.
A1. calling adb commands time to time keeps adb server online.
Q2. wifi connected device sometimes disconnect.
A2. Before you check your wifi on the connected device, check the wifi that your ADB server is running on. Ping to google and if it is well connected, ping to the device.
Wireless can disconnect on its own and even wired connection is sometimes disconnected. so calling "adb connect ..." when the device is not already connected is necessary. You could do this easily by saving "adb devices > device.txt" and query out whether your expected wifi is on the list. If not, connect again..(do this in another thread).
Q3. wifi connected device is sometimes offline.
A3. This is because by TCP/IP connection your ADB server is now on Time_Wait stance. The last connection was interrupted that the next connection is now offline because the last connection is not completely shut down. You can either manually disconnect/connect your device's wifi or restart TCPIP connection by ex) "adb tcpip 5555"
If you want to do this automatically, you are going to have to disconnect/connect your device's wifi programmatically.
Leave any other questions and I can answer on the comments.
When connection is lost and adb devices shows device is offline, like this:
prompt> adb devices
List of devices attached
192.168.1.1:5555 offline
then adb disconnect IP followed by adb connect IP will often work:
prompt> adb disconnect 192.168.1.1
disconnected 192.168.1.1
prompt> adb devices
List of devices attached
prompt> adb connect 192.168.1.1
connected to 192.168.1.1
prompt> adb devices
List of devices attached
192.168.1.1:5555 device
Use adb over wi-fi without any third-party apps. Follow the steps.
Connect device via USB
Open your terminal and check your device is listed with adb devices command
Type adb tcpip 5555 and enter (or use another port instead of 5555)
Plug out your USB cable. You don't need it anymore.
Take your Android phone and go Settings/About/Status
Check the IP address part. Let's say your IP address is 192.168.x.y
In your terminal, write the command adb connect 192.168.x.y
Now, you have connected your device via wi-fi.
You can see your device in adb devices
Enjoy it! :)
This seems like an issue with your wifi. As a precaution, just keep the terminal open and whenever you need to test just press the 'UP arrow' key to get to previously ran adb connect "<ip>" command.
I tried many ways but this one worked out for me:
force the display on and of in a loop would keep the device online
adb shell input keyevent 224
timeout 2
adb shell input keyevent 26
timeout 58
this turns the display on every minute for 2 seconds
So, I'm using Scrcpy and Adb to wirelessly connect to my Phone(for developing Flutter Apps) and since the screen wasn't staying awake even by Scrcpy --stay-awake command.
I had to change Lock Settings=>Lock Screen => Sleep, and settings to Never Sleep.
The whole point of setting up wireless adb was so that I would not have to connect it to via usb everytime.
via this question : https://stackoverflow.com/a/3623727/4645236 I started wireless debugging with a device. Worked great! Super convenient without a doubt.
Now I am wondering if there is a way keep this setting and not have to plug in every time...
I'd like to wirelessly connect to the device via the PC terminal in one command,
even if the server has been killed and restarted.
Is this possible? Or do I have to use a script?
As long as the ADB daemon on your device is not restarted you can connect to your device via WiFi (ADB over tcp) without it connected through usb.
if it restarts, you will have to connect to the device via usb and run:
adb tcpip <port>
simply turn on your wireless adb on the device and connect however you do so wirelessly is all it takes. so example is (adb connect 192.168.1.xxx). thats it. Shouldn't have any memory issues.
I have two Galaxy S3. One of them is rooted and the other one is not. So, when I tried to connect them over the local network, computer can see the rooted one. But normal one stucks on the tcpip step. So, I write
adb tcpip 5555
It says
restarting in TCP mode port : 5555
but nothing else. Can you help me with these?
Note: My OS is Win8.
After running
adb tcpip 5555
What is the ouput when you try to run the "connect" command to the devices based on knowing the IP of the phone e.g.
adb connect 192.168.1.186
should result in something like:
connected to 192.168.1.186:5555
Also, make sure you have USB debugging turned on on the Samsung 'Settings' --> 'Developer options'
(If you don't see 'Developer Options', you'll need to enable it first (link))
I have made a small script for myself
Simply Connect your device (in USB debugging mode).
Go to location "C:\Users\PC\AppData\Local\Android\sdk\platform-tools"
Press Shift + Right Click --> open Command window here.
Paste that script there , make sure adb.exe is available at that path in PC.
run wireless.bat follow steps give your IP that's it.
wireless.bat
I have an android device which I want to connect to using ADB. For reasons that don't matter here I need it to have an ethernet connection, not wifi. The device itself refuses to have both ethernet and wifi connections at the same time.
I have been using a third party app called ADB WiFi to connect to it with ADB when it is in WiFi mode, and I have found that I can connect to it in wifi, then switch the device into ethernet, and then reconnect to the new IP, and it works.
I would dearly like to be able to connect to my device (which is often remote and hard to reach) without first switching it into wifi and back, to which end I have written my own little app which uses SU and does:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
It says that it is working when I run it and produces no error messages, but I can't connect afterwards. It doesn't work in wifi mode either. After setting up a connection once using the 3rd party app, I can then use stop adbd to prevent adb working, and I can use my application above to enable it again, without wifi or 3rd party intervention, which suggests that it is doing what it thinks it is doing, but missing a one off step.
Does anyone know if there is another thing that must be set / enabled / poked in order for adbd to work? Does anyone know what I'm missing?
Thanks
Have you tried this:
adb tcpip 5555
adb connect 192.168.1.1:5555
replacing the 192.168.1.1 with your phones IP Address?
I was able to get both ADB (through USB) and Ethernet, but it was device specific. I used the Asus Transformer Pad TF701T with the keyboard dock. The dock allowed me to connect the ADB cable and provided a full size USB port. I connected a compatible USB to Ethernet adapter to get Ethernet.