Android ADB Setting
Android ADB Setting Before This for any debugging or to test the android application we have to use the USB Cable to connect as a Emulator. So far, whenever I was working on my Android apps, I had to connect it to my laptop with a USB cable. The USB cable is annoying and limits my movements. Consequently, I was researching, if there is an option to do the debugging over WiFi.
- First Steps is to check whether the USB Debugging Mode is Active or not. To Check that. Go to
Setting—————->Development Mode ———————> USB Debugging
2. After That Go to the ADB Setting and Open the ADB Location.
3. Now Open Command Prompt under ADB to connect over the WIFI. By Key Combination (“Left Shift + Right Click”)
4. After That Command prompt is open and type the following command.(your device need to connect with USB Cable for initialization )
"adb devices" to see List Of Devices that is attached
5. After That type Or Initialize the TCPIP Port to ADB as follows.
adb tcpip 8888
6. Now Unplug/Disconnect your Smartphone From USB Cable.
7. Now go to your device.
Setting ————->About Phone ————->Status—————-IP Address
Now Copy that Ip Address and go back to the Command Prompt.
8. Type the following to connect your phone with adb Wireless.
adb Connect Ipaddress:Port adb connect 10.0.2.85:8888
9. Now you are free to use this feature and Run/Debug the Application.
Do I Have to Repeat the Process Every Time?
Now you might ask, what do I have to do when I move into a different work space and change WiFi networks? You do not have to repeat steps 1 to 4 (these set your phone into WiFi-debug mode). You do have to connect to your phone again by executing steps 5 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!
Happy wireless coding!