Adb over wireless without usb cable at all for not rooted phones
AndroidRemote DebuggingAndroid WifiAndroid Problem Overview
I want to debug Android APPs on my phone (LG nexus 4). I'm travelling and I forgot my USB cable. When I work at home I can do it just connecting the USB cable and executing the command 'adb tcpip 5555'. Then I can unplug the USB cable and connect via 'adb connect IP'.
But now I cannot execute the first command because I don't have a cable. I don't understand why I have to do it every time, since I already execute the 'adb tcpip' command before.
What I tried now:
I installed a terminal application on my Android and tried to execute that command there, but I received a "device not found" error. Maybe he cannot see himself...
I search for any reasonable option in "Android Development Options" and enabled everything seemed to have relation with Wifi. But nothing helped.
I search StackOverflow, but all answers I found involving connect via USB cable before. Is there I way to do this connection without the need of a cable at all?
Some info: My Nexus 4 isn't rooted. The android version is 5.1.1.
Android Solutions
Solution 1 - Android
The question is about a non rooted device but if it is rooted the simplest way would be to:
From the terminal on your phone, do this:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
See this answer for full details.
Solution 2 - Android
For your question > Adb over wireless without USB cable at all for not rooted phones
You can't do it for now without a USB cable.
But you have an option:
Note: You need to put USB at least once to achieve the following:
You need to connect your device to your computer via USB cable. Make sure USB debugging is working. You can check if it shows up when running adb devices
.
Open cmd in ...\AppData\Local\Android\sdk\platform-tools
> Step1: Run adb devices
Ex: C:\pathToSDK\platform-tools>adb devices
You can check if it shows up when running adb devices.
> Step2: Run adb tcpip 5555
Ex: C:\pathToSDK\platform-tools>adb tcpip 5555
Disconnect your device (remove the USB cable).
> Step3: Go to the Settings -> About phone -> Status to view the IP address of your phone.
> Step4: Run adb connect <IP address of your device>:5555
Ex: C:\pathToSDK\platform-tools>adb connect 192.168.0.2
> Step5: Run adb devices
again, you should see your device.
Now you can execute adb commands or use your favorite IDE for android development - wireless!
Now you might ask, what do I have to do when I move into a different workspace and change WiFi networks? You do not have to repeat steps 1 to 3 (these set your phone into WiFi-debug mode). You do have to connect to your phone again by executing steps 4 to 6.
Unfortunately, the android phones lose the WiFi-debug mode when restarting. Thus, if your battery died, you have to start over. Otherwise, if you keep an eye on your battery and do not restart your phone, you can live without a cable for weeks!
See here for more
Ref: https://futurestud.io/tutorials/how-to-debug-your-android-app-over-wifi-without-root
UPDATE:
If you set C:\pathToSDK\platform-tools
this path in Environment variables then there is no need to repeat all steps, you can simply use only Step 4 that's it, it will connect to your device.
To set a path:
My Computer-> Right click--> properties -> Advanced system settings -> Environment variables -> edit path
in System variables -> paste the platform-tools
path in variable value -> ok -> ok -> ok
UPDATE 2:
-
Go to the android terminal
-
adb tcpip 5555
-
adb connect your_ip_address
Solution 3 - Android
Had same issue, however I'm using Macbook Pro (2016) which has USB-c only and I forgot my adapter at home.
Since unable to run adb at all on my development machine, I found a different approach.
Connecting phone with USB cable to another computer (in same WiFi) and enable run adb tcpip from there.
> Master-machine : computer where development goes on, with only USB-C connectors > > Slave-machine: another computer with USB and in same WiFi
Steps:
-
Connect the phone to a different computer (slave-machine)
-
Run
adb usb && adb tcpip 5555
from there -
On master machine
deko$: adb devices List of devices attached deko$: adb connect 10.0.20.153:5555 connected to 10.0.20.153:5555
-
Now Android Studio or Xamarin can install and run app on the phone
> Sidenote: > > I also tested Bluetooth tethering from the Phone to Master-machine and successfully connected to phone. Both Android Studio and Xamarin worked well, however the upload process, from Xamarin was taking long time. But it works.
Solution 4 - Android
If usb is not working you should checkout debugging over bluetooth (Without Rooting)
http://zcourts.com/2013/07/19/android-debugging-over-bluetooth-without-root/#sthash.hVCLtWSk.dpbs
Solution 5 - Android
This might help:
If the adb connection is ever lost:
Make sure that your host is still connected to the same Wi-Fi network your Android device is.
Reconnect by executing the "adb connect IP" step. (IP is obviously different when you change location.)
Or if that doesn't work, reset your adb host:
adb kill-server
and then start over from the beginning.
Solution 6 - Android
type in Windows cmd.exe
cd %userprofile%\.android
dir
copy adbkey.pub adb_keys
dir
copy the file adb_keys to your phone folder /data/misc/adb. Reboot the phone. RSA Key is now authorized.
now follow the instructions for adb connect, or use any app for preparing. i prefer ADB over WIFI Widget from Mehdy Bohlool, it works without root.
from: https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp
Solution 7 - Android
Connect android phone without using USB cable except XIAOMI PHONES
== MAKE SURE THAT YOUR PHONE HAS USB DEBUGGING ENABLED ==
== IP Address series should NOT be '0' like 192.168.0.10
- Connect your PC (Laptop) and Android phone to same wifi network.
- Go to the Android SDK folder > platform-tools and open command prompt by holding the shift key and right clicking on the folder.
- Type the command "adb tcpip 5555", and hit Enter, sometimes it gives an error but ignore it and go ahead.
- Type "adb connect [YOUR PHONE IP]". example: "adb connect 192.168.1.34" and hit enter, your phone will be connected to PC.