0

My setup:

I have mac which has the android tools. And a windows virtual machine - which unfortunately can't run android directly. So I have connected them following this guide: https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/questions/connect-android-emulator-mac-windows and they are on the same vpn.

I can see the emulators started on my mac and run my xamarin app successfully from the windows machine:

enter image description here

But when connecting an android device to the mac it won't show up in visual studio on the windows machine. Running adb devices on my mac it shows up:

enter image description here

And I can run apps on it successfully from other frameworks that I have installed on my mac.

Is there some way I can expose the android device for visual studio to find via the adb server?

lolelo
  • 698
  • 6
  • 18
  • Possible duplicate of [How can I connect to Android with ADB over TCP?](https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp) – Cheesebaron Nov 03 '19 at 18:32

1 Answers1

0

I think you will have better luck if you are using ADB over network.

On the computer where you have connected the devices you can run:

adb tcpip 5555

Then if you know the IP of the device you can connect from any computer on the same network with:

adb connect ip:5555

Then it should appear in VS in the device list.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
  • The `adb connect` never finishes. I am not 100% what the `tcpip` does but note that the mac and the virtual windows machine are on the same vpn. I assume the device also has to be on the same vpn to be able to connect it via i'ts ip address? – lolelo Nov 03 '19 at 19:18
  • The device needs to be on the same network you are connecting to with your VPN software. – Cheesebaron Nov 03 '19 at 20:12
  • I'ts an azure vpn. To which I have both the mac and the virtual windows machine connected to. I don't think I can connect a mobile device to it. It's using IKEv2 with encryption. – lolelo Nov 03 '19 at 21:01
  • Yea, doing it the other way, from the VM to the network the mac and the device is on would be much easier. – Cheesebaron Nov 03 '19 at 21:10
  • It's just that I would have to go into router settings to open ports I believe. Which is a bit unsafe. And I would also like to able to work where I want. – lolelo Nov 06 '19 at 14:47