Android USB debugging in VirtualBox

前端 未结 6 1748
花落未央
花落未央 2020-12-24 07:11

I am trying to get mono for android (aka monodroid) working within a windows 7 virtual machine on virtualbox but I am having issues with the adb connection to my phone. Whe

6条回答
  •  温柔的废话
    2020-12-24 07:57

    I'm posting this here for people with a setup similar to mine:

    • Host OS: OSX (10.15.4 Catalina)
    • Client OS: Windows 10 Enterprise (v1903 build 18362.752)
    • VirtualBox v6.1.4
    • Android Studio v3.6.2

    To allow Android Studio in client OS (Windows) to connect to an Android phone (using adb) via USB:

    1. Update to latest version of VirtualBox (currently 6.1.4)
    2. Install VirtualBox Extension Pack from here
    3. With the VM powered down, go to Settings > Ports > USB and make sure the USB 3.0 (xHCI) Controller is enabled, then click "OK"
    4. From the host OS (i.e. OSX) open up a terminal and start adb and confirm that the phone is connected by running adb devices
    5. Start up the VM, and from the VirtualBox menu select Devices > USB > [YOUR PHONE] to connect your host OS USB port to the VM
    6. Open up a terminal on the client OS (Windows) and run adb devices to confirm that the adb server is running and can find your phone. You might need to add the Android platform tools to your PATH (mine was at C:\Users\Username\AppData\Local\Android\Sdk\platform-tools). This step might be optional--I suspect that Android Studio might start up adb on its own.
    7. Start up Android Studio in the client OS (Windows) and go to File > Settings > Appearance and Behavior > System Settings > Android SDK > SDK Tools and make sure that the Google USB Driver is installed (see screenshot here)

    After I did these things, Android Studio was able to detect my phone and run/debug apps using that device.

    Hope this helps!

提交回复
热议问题