Android custom emulator (ranchu) for AOSP 6

I need to create a custom version of the Android emulator and start by restoring the emulator without any changes for AOSP 6.0.1 R62.

To my surprise, the emulator source code is no longer included in AOSP. Emulators are displayed in advance in the AOSP repository. After some research, I managed to build qemu (ranchu):

  • I downloaded qemu sources:

    git clone -b qemu-android-2.2.0 \ https://android.googlesource.com/platform/external/qemu-android 
  • I downloaded the Android build scripts for qemu, which are in another repository:

     git clone https://qemu-android.googlesource.com/qemu-ranchu 
  • I ran qemu-ranchu/scripts/rebuild.sh

The script built qemu and generated the binary qemu-system-aarch64 in qemu-ranchu/binaries/linux-x86_64/ . AOSP has a file with the same name in $aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/ , but it is not the file that the end user will execute. An Android developer would execute an executable called emulator in $aosp/prebuilts/android-emulator/linux-x86_64/ , which seems to be a kind of shell around bare qemu.

So, topical issues:

  • Is there any ranchu build documentation and everything that it includes? I can not find: (
  • Do emulator* executables execute qemu inside them, or do they execute external binary qemu?
  • If I aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/ qemu binaries in aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/ with my custom binaries, would emulator actually trigger my custom qemu?
  • Is it possible to bypass emulator and run my qemu-system-aarch64 directly to load an AOSP image? Or is it crazy to try to tune it?
  • Where are the sources of all emulator* binaries?
+5
source share

Source: https://habr.com/ru/post/1257437/


All Articles