Thursday, 5 March 2015

Debug android device over wifi in ubuntu/linux

Non-Rooted Devices

1.Connect the Phone to computer with USB.     
  • Go to android sdk platform tools path
           $ ./adb devices
  • install adb using  sudo apt-get install android-tools-adb
           $ adb devices

     your device will display with serial number if it is not displayed change the USB connection to MTP or PTP

2.There are two ways to set properties
  •  Normal method         
           $ ./adb tcpip 5555
           $ adb tcpip 5555
  • If above not worked then try this
          $ adb shell or ./adb shell
          $ setprop service.adb.tcp.port 5555
          $ stop adbd
          $ start adbd

3.To Get ip address

          $ adb shell or ./adb shell
          $ netcfg 
         it will display all interfaces ip ,you take IP of wlan0

4.Now remove the USB from system and type in terminal

         $ adb connect ip:5555
          It will show connected status

Rooted Devices


1.Download the Terminal emulator for android from the play store link.


2.Type the below commend in terminal
     
          $ su
          $ setprop service.adb.tcp.port 5555
          $ stop adbd
          $ start adbd

3.To Get ip address

          $ adb shell or ./adb shell
          $ netcfg
         it will display all interfaces ip ,you take IP of wlan0

4.Now remove the USB from system and type in terminal


         $ adb connect ip:5555    
          It will show connected status
       
Note : Mobile and Computer should be connected to same local network.