Categories
Uncategorized

WiFi Android Debugging

I have a Galaxy S9. It works but the USB-C connector is a bit loose. I have had it replaced once and do most of my charging via a mat. However I still need the connector for deploying and debugging apps.

Well, it turns out you can deploy and debug via wifi. It is dead slow but it works. I got most of the details form here and here. Once you have your batch file correct, you run it and your phone magically appears as a launch option in Visual Studio.

First get the IP address of your phone from

Setting->Connections->Wifi->Current Network->Settings

and your device name from the Stack Overflow link. In my case I had emulators running as well as my phone so it is easier just to hardcode the command to work on your phone. Put the following into a batch file and change 227bef7922047ece to your device name and 192.168.0.30 to your phones IP address.

@echo off
echo starting
::ENTER YOUR CODE BELOW::
echo Android bits
cd C:\Program Files (x86)\Android\android-sdk\platform-tools
adb -s 227bef7922047ece tcpip 5555
adb -s 227bef7922047ece connect 192.168.0.30:5555
::END OF YOUR CODE::
echo Finished
pause

Then connect your phone via USB, run the batch file, unplug the USB and check Visual Studio. As I said earlier, it is dead slow but you can do most of your debugging in the emoulator and just deploy the odd build this way.

More detail here.

Leave a Reply

Your email address will not be published. Required fields are marked *