• (OK) Running Android in a VirtualBox VM



    https://www.ricston.com/blog/running-android-virtualbox-vm/


    The first question that may come to mind after reading this blog post’s title is: “Why would I want to run Android in a VM when I have the emulator?”. For me it boils down to two main reasons:

    1. Android runs significantly faster in a VM compared to the emulator.
    2. VirtualBox offers support for devices such as Bluetooth whereas the emulator doesn’t. This means you can test Android Bluetooth applications in a VM.

    There are two ways to make Android run on a VirtualBox VM. The first approach is well known: download the Android x86 fork and follow instructions from the fork’s project website to create a bootable ISO file. From there on, it’s easy to install Android on a VM. The drawback to this approach is that you won’t have the latest Android code. Additionally, changes you make to the fork must be merged with the AOSP (Android Open Source Project) for them to be included in future releases of Android.

    The second approach gives you direct access to the latest Android code. However, it’s barely documented due to the fact that previously you couldn’t build ‘out of the box’ an Android VDI (Virtual Disk Image) with the AOSP. To build the Android VDI and install it in your VM, follow these steps:

    1. Get the Android source code from the AOSP site and follow the online instructions to setup the environment.


    2. When you are ready to build the project, execute the following command to set the environment variables for Make: “lunch vbox_x86-eng”.


    3. Run “make installer_vdi” to build the project. Make will build the project and produce a VDI named “installer.vdi” located in “out/target/product/vbox_x86”. This VDI contains Android plus its installer.


    4. Create a Linux VM and add the “installer.vdi” as an extra HD to the VM.


    5. Start the VM and press “F12” during bootup.


    6. Select the HD which represents the “installer.vdi”.


    7. Choose the first option, that is, “Android Install to /dev/sda from /dev/sdb”.


    8. When installation is complete, enter the command “reboot”. After that, you should be able to launch Android from your VM.


    One small note, I had several problems trying to compile Android for VirtualBox from my Mac OS X. So probably the best solution is to build Android from Linux.


  • 相关阅读:
    ASP.NET MVC随想录——锋利的KATANA
    ASP.NET MVC随想录——漫谈OWIN
    Notepad++ 64位 插件管理
    C#实现按键精灵的'找图' '找色' '找字'的功能
    http://www.haolizi.net/example/view_2380.html
    C# 关于在原图中寻找子图片坐标的类
    WebBrowser控件默认使用IE9,IE10的方法
    Springboot---后台导出功能,easyExcel
    vue---EleElement UI 表格导出功能
    vue---提取公共方法
  • 原文地址:https://www.cnblogs.com/ztguang/p/12645393.html
Copyright © 2020-2023  润新知