1-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
(or tns device
).
2-Run adb tcpip 5555
3-Disconnect your device (remove the USB cable).
4-Go to the Settings -> About phone -> Status to view the IP address of your phone.
5-Run adb connect <IP address of your device>:5555
6-If you run adb devices
(or tns device
) again, you should see your device.
7- Now you can use tns run android
, tns livesync android
commands.
NOTES :
1-when WiFi network changes 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.
2-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!
WARNING :
leaving the option enabled is dangerous, anyone in your network can connect to your device in debug, even if you are in data network. Do it only when connected to a trusted Wi-Fi and remember to disconnect it when done!
reference:
1-Norman Peitek. 2014. How to Debug Your Android App over WiFi (without Root!). [ONLINE] Available at: https://futurestud.io/blog/how-to-debug-your-android-app-over-wifi-without-root. [Accessed 8 August 2016].
2-usethe4ce. 2012. Run/install/debug Android applications over Wi-Fi?. [ONLINE] Available at: http://stackoverflow.com/a/10236938/4146943. [Accessed 8 August 2016].