Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging in Android device over wifi without rooting [duplicate]

Tags:

android

adb

Is there any possible way to debug or run android apps from eclipse to my Sony Tablet S over wifi rather than USB without rooting the device?

There are ways to do it, if the device is rooted. However, I am seeking the solution in a device that is not rooted.

like image 505
Anik Avatar asked Dec 16 '12 13:12

Anik


People also ask

Can you ADB over Wi-Fi?

If you are an Android developer, I am 100% sure you might already be frustrated with debugging your App with ADB while being connected through a USB cable. If you didn't know already, you can connect to your Android Device with ADB over Wifi.

What is Wi-Fi debugging?

Overview. WiFi debugging allows WebIDE to connect to your Firefox OS device via your local WiFi network instead of a USB cable.


4 Answers

  • Disconnect device from usb then tell it to listen on 4455

    adb tcpip 4455

restarting in TCP mode port: 4455

  • connect to the device using a specified ip:port. my device is using wifi

    adb connect 192.168.1.103:4455

connected to 192.168.1.103:4455

  • now do normal adb commands over tcp like

    adb shell

  • when your done, you can put it back in USB mode adb usb restarting in USB mode

like image 187
RPB Avatar answered Oct 05 '22 22:10

RPB


After a bit of dabbling with testing I successfully managed to connect a Sony Tablet S over ADB following this procedure, when both the computer and the tablet were on the same wifi network. I used an Xperia T as a tethering point between a laptop and the Tablet S. I followed the same procedure on an Xperia Tablet S and an Xperia S as well.

  1. Connect the Sony Tablet S through USB to a computer, make sure you have ADB debugging enabled on the tablet.
  2. On the computer, execute "adb devices", verifying the tablet is showing up in the list of available devices.
  3. Execute "adb tcpip [port]" while the tablet is connected to the computer, verifying you get a response "restarting in TCP mode port: [port]"
  4. Disconnect from the device from the computer it was connected to.
  5. From a host located on the same wifi network, execute "adb connect [ip to device]:[port]", verifying you get a response "connected to [ip to device]:[port]"

In the end I launched Eclipse, created a test project and tried launching the project. The project installed and launched automatically from Eclipse. I also tested this for debugging and that worked equally well.

like image 36
shellström Avatar answered Oct 06 '22 00:10

shellström


Finally After lots of search, here is the consolidated, short tutorial about "Wireless Debugging with Android without rooting" your android phone.

Steps:

  1. Make sure your Phone and your PC/Laptop is connected in the same network.
  2. Find your Android Device's IP Address: Go to Settings > About Phone > Status. Note down it.
  3. Ping Test: Lets first check if your phone is accessible from your PC/Laptop to do this ping your Android Device and check its response. See Notes if ping is unsuccessful.

e.g: ping 192.168.1.55

  1. Connect your Android Device Via USB in USB Debugging Mode.
  2. Open command prompt and cd into <Android SDK Folder>\platform-tools directory and run the following commands.
adb tcpip 5555
adb connect DEVICE_IP_ADDRESS_HERE:5555
  1. If you want to switch back to USB mode, use the following command.

adb -s DEVICE_IP_ADDRESS_HERE:5555

Disconnect Android Device from USB. If everything is fine, you can Wirelessly debug your Android Apps!

Notes:

  • If ping is unsuccessful, Make sure Wireless (WiFi) devices and wired devices are not isolated. If Isolated, you need to disable isolation. Router Mfgrs calls it as AP Isolation. There will be a setting in Router's Wireless Configuration page. I have D-Link Router, I unchecked the Enable MultiAP Isolation setting in Wireless Basic Setup Page.
  • I personally felt this method of connecting is taking more time.. so, I configured my android device so it uses static IP like 192.168.1.55 to connect to my router and I made a windows batch file like below,
@echo off
cd C:\AndroidSDK\platform-tools\
echo make sure your your Phone is connected in USB Debugging Mode.
pause
adb kill-server
adb tcpip 5555
adb connect 192.168.1.55
pause

so, every time I have just need to plug in my device, and double click the batch file and all done automatic :P !

like image 33
Nithi2023 Avatar answered Oct 05 '22 23:10

Nithi2023


(No root required) There is one best, easy and with UI method for Android Studio

IntelliJ and Android Studio plugin created to quickly connect your Android device over WiFi to install, run and debug your applications without a USB connected. Press one button and forget about your USB cable.

just install plugin Android WiFi ADB

Download and install Android WiFi ADB directly from

Intellij / Android Studio: Preferences/Settings->Plugins->Browse Repositories

enter image description here

enter image description here

.

Remember! for first time to initialize the device you must have to connect using usb

Alternatively, you can download the plugin from the JetBrains plugin site and install it manually in: Preferences/Settings->Plugins->Install plugin from disk.

for more information read here https://github.com/pedrovgs/AndroidWiFiADB

like image 29
Mureed Hussain Avatar answered Oct 05 '22 23:10

Mureed Hussain