I thought there was a way to test your applications in development over Wi-Fi. Is this possible?
I\'d love to be able to untether my phone and develop wirelessly.
Though there are so many good answers, here is my two cents for the future me :P and for anyone who wants it quick and easy.
For Mac:
open terminal and run the following script
adb tcpip 5555
adb connect $(adb shell ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | cut -d: -f2):5555
Explanation:
adb tcpip 5555
commands the device to start listening for connections on port 5555
adb connect $(_ip_address_fetched_):5555
tells to connect on port 5555 of the _ip_address_fetched_
address
where _ip_address_fetched_
includes following:
adb shell ifconfig
getting internet configurations using adb shell
grep "inter "
filter any line that starts with inter
grep -v 127.0.0.1
exclude localhost.
At this point, output should be like:
inet addr:###.###.#.### Bcast:###.###.#.### Mask:255.255.255.0
awk '{print $2}'
get the second part of the components array, separated by space (I'm using zsh).
The output up to this point is
addr:###.###.#.###
cut -d: -f2
split the string by delimiter : and take second part. It will only take your device IP address
For Ubuntu / Linux:
./adb devices
to list the connected devices. Make sure it is only one device connected and no emulator running../adb shell
then netcfg
. You will see a list of IP addresses. Find wlan0
, in my case 192.168.100.3/2../adb tcpip 5555
./adb connect <Your device IP Address>:5555
in your terminal. You can now deploy the application to your device over Wi-Fi.I found my answer here:
Make sure adb is running in USB mode on host.
$ adb usb
restarting in USB mode
Connect to the device over USB.
$ adb devices
List of devices attached
######## device
Restart host adb in tcpip mode.
$ adb tcpip 5555
restarting in TCP mode port: 5555
Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address
. Remember the IP address, of the form #.#.#.#.
sometimes its not possible to find the IP-address of the android device, as in my case. so u can get it using adb as the following:
$ adb shell netcfg
and the should be in the last line of the result.
Connect adb host to device:
$ adb connect #.#.#.#
connected to #.#.#.#:5555
Remove USB cable from device, and confirm you can still access device:
$ adb devices
List of devices attached
#.#.#.#:5555 device
You're now good to go!
If the adb connection is ever lost:
Or if that doesn't work, reset your adb host:
adb kill-server
and then start over from the beginning.
The best way is using ADBConnect (Eclipse plugin) and ADB Wireless (app for Android device).
After a long search I found :
I must run
adb connect <device_ip_address>:5555
after disconnecting USB.
Download the app Wifi ADB
on the play store. Very easy to use and works like a charm! :)