求推荐可在VirtualBox虚拟机运行的Android模拟器及跨机运行可行性咨询
Hey there! Let's tackle your two questions one by one based on my experience with virtualized environments and Android emulation:
Here are a few reliable options that play nice with VirtualBox, provided you've enabled nested virtualization (check your VM's settings under System > Processor and tick the "Nested VT-x/AMD-V" option):
- Genymotion (Personal Edition)
This is a go-to for many developers in virtualized setups. It’s lightweight compared to some alternatives, supports a wide range of Android versions, and integrates smoothly with development tools. Just make sure your VirtualBox VM has enough allocated RAM (at least 4GB recommended) to run it without lag. - Android-x86
If you prefer a free, open-source option, Android-x86 lets you install a native x86 Android system directly as a VirtualBox VM. You can download the ISO, create a new VM with appropriate settings (allocate at least 2GB RAM, enable graphics acceleration), and install it like any other OS. It’s great for basic testing and doesn’t require extra licensing. - BlueStacks (Game-Focused, but Functional)
While BlueStacks is primarily built for gaming, some versions work in VirtualBox with nested virtualization enabled. Keep in mind it uses more resources than the other options, and its developer tools support is limited—but if you just need a working emulator quickly, it’s worth a shot.
Absolutely, this is a viable solution. Here's how to set it up:
First, prep the remote machine
Install your preferred Android emulator (Android Studio's official emulator, Genymotion, etc.) on the remote machine with a public IP. Ensure the emulator can run locally on that machine (enable hardware acceleration like VT-x/AMD-V for smooth performance) and that the remote machine's firewall allows incoming connections on relevant ports.Configure adb port forwarding
Android debugging relies onadb, which uses port 5037 by default, plus a pair of ports per emulator instance (e.g., 5554/5555 for the first emulator):- On the remote machine, start the adb server:
adb start-server - From your local VirtualBox VM, connect to the remote adb server:
adb connect <remote-machine-public-ip>:5037 - If the remote emulator is already running, you’ll see it listed when you run
adb deviceson your local VM.
- On the remote machine, start the adb server:
Optional: Router port mapping (if needed)
If the remote machine is behind a router, you’ll need to set up port forwarding on the router to map ports 5037 and the emulator’s specific ports (like 5554/5555) to the remote machine’s local IP.
Once connected, you can select the remote emulator directly in VS 2017 for debugging—just like you would with a local device. Note that network latency might affect debugging speed, so a stable, high-bandwidth connection is ideal.
内容的提问来源于stack exchange,提问作者gilpach

