0

I need to develop for Android inside a VM on macOS, so I created a macOS VM on my mac m3, using UTM.

Since I cannot run the Android Emulator inside the VM, I ran it outside, now it's just a matter of connecting the Android Studio inside the VM to the Android Emulator outside the VM.

Android has a feature to connect over network by pairing codes. If the VM shared the same network as the host, it would work. I tried bridge and networking mode and it didn't work.

My idea (which I didn't try yet) would be to ssh from host to guest, with a reverse proxy, then connect with ADB.

Is there a very easy way to do this connection?

1 Answer 1

1

My current solution is to SSH from the host to the guest, with a reverse proxy on port 5037, thus the ADB running on the host becomes the adb on the guest and the guest Android Studio finds the host Android Emulator.

On the host:

ssh -R localhost:5037:localhost:5037 machine@vm_ip

And make sure the adb on the local adb on the guest is not running:

adb kill-server

Also if something goes wrong try to restart both adb servers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.