0
votes

I have been trying to get the source code to compile from some time and finally got it compiled. However I am having issues with the emulator where it shows a pop up screen but is quite blank.

I am using Ubuntu Server Xenial and Android 7.1.1 for Nexus6P (but I dont own a Nexus6P so I need to run this on the emulator)

I have tried specifying all the directories such as (-sysdir,-sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache, -sdcard) although I know that these are supposed to be auto populated by the envsetup.sh file.

The command I used is this:

emulator -kernel ./prebuilts/qemu-kernel/arm64/kernel-qemu -ramdisk ./out/debug/target/product/angler/ramdisk.img -sysdir ./out/debug/target/product/angler/ -cache ./out/debug/target/product/angler/cache.img -system ./out/debug/target/product/angler/system.img -data ./out/debug/target/product/angler/userdata.img -memory 4096 -partition-size 4096 -sdcard sdcard.img -skindir ./sdk/emulator/skins/ -skin WVGA800

I changed the kernel to others such as for ARM/ARM64 but to no avail. All I see is a blank emulator and after changing it to ARM following error:

http://pastebin.com/A04NmNLn

I am at a loss as to why the emulator wont work. Also where is the "image" file with which we can install the Android on Genymotion-type external emulator.

Any help is appreciated!

1
Just after building your code, try to run emulator in the same terminal. If it works than the command that runs emulator without setting the environment needs to be modified. - Yury
I did try to run emulator, all I got was a window saying QEMU and inside it was nothing but garbled image of whatever it was on top of (this time it was the terminal). - SamT01
Ooops, I missed one point. What target do you use to run your build? If you build Android for emulator, you need to use aosp_arm-userdebug, aosp_x86_64-userdebug or something similar. Do not build for Nexus 6P - Yury
If I build for aosp_arm-userdebug what kind of binaries should I be downloading for the emulator to run? From here: source.android.com/source/requirements.html#binaries. Also what branch should I be repo-ing, I currently have the Android 7.1.1 as I mentioned in the question. - SamT01
You do not need to download any additional binaries. Just build your AOSP using the targets I've specified. - Yury

1 Answers

1
votes

In order to build AOSP to be run in emulator, there is no need to download any additional binaries. At the same time, emulator cannot run images build for real devices. Therefore, it is required to only download the sources of Android and execute the following commands within the directory with the downloaded sources:

source build/envsetup.sh
lunch aosp_arm-eng #or aosp_x86_64-eng, etc. for details see documentation
make -j4

After the sources are build in the same terminal run the emulator command and the emulator should appear.