Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wifi debugging on android from visual studio mac

Is this possible to debug android from a mac over Wifi? I am using visual studio version 7.4.2. I know how to do this using windows but on mac it is challenging for me.

like image 372
Mannu Avatar asked Feb 17 '26 05:02

Mannu


2 Answers

Answering this question for posterity since it's a link answer

  1. connect usb to device and check for adb connection

    adb devices

  2. set tcpip port mode in adb, any number above 1000 is usually safe, change selection if there is an error

    adb tcpip 5555

  3. find local IP address of device, you can usually see this in wifi settings, for eg on galaxy s5 i long pressed my wifi connection and clicked modify wifi connection to see it. this is device specific unfortunately

  4. connect to the IP address listed via adb, in my case it was 192.168.1.21, it will probably be different for you,5555 is the port we entered earlier

    adb connect 192.168.1.21:5555

  5. type adb devices again and you will see the device attached as the IP name. to verify that it is your device use

    adb devices -l

which will show the model of the device as well.

Now switch over to your studio (xamarin/visual) and you'll see the device as an option to deploy to.

like image 60
Karan Harsh Wardhan Avatar answered Feb 20 '26 03:02

Karan Harsh Wardhan


Google just enabled this from Android 11 onwards. Follow these steps to setup your device to build and debug wirelessly using your wifi connection:

  • On your Android 11 device, go to your Settings -> Tap on Advanced and go to the Developer options.
  • Then tap on Wireless Debugging switch, and always allow wireless debugging for your personal wireless network in the popup dialog
  • Then tap on the Wireless Debugging option and select “Pair device with pairing code” and it will give you a 6 digit code and IP address as you can see in the image
  • There are many ways of doing pairing the phone to your computer. For the simplest one, inside Visual Studio, go to Tools -> SDK Command Prompt and type the IP address and port from your phone above into the terminaladb pair {ipaddress}:{port}.
  • Then take the IP Address and port from the last screen and enter the following command adb connect {ipaddress}:{port}.

There’s a lot more details in this article Including limitations and a comparison with the iphone wireless debug feature

like image 33
Saamer Avatar answered Feb 20 '26 04:02

Saamer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!