Running emulator after building Android from source
I do not know for which product you do your build but to run emulator you can use the following command:
out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -sdcard sdcard.img -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 1024
Just copy it into .sh file into the root of your Android source folder and run this file. Or you can just run it but you should chdir to your Android source folder root at first.
And do not forget to create an sdcard image in the root folder with command mksdcard
.
Unable to start emulator after build AOSP
The emulator is added to current path when I run
source build/envsetup.sh
lunch full-eng
How to run an Android 10 system image built by myself on emulators?
After understanding more about AOSP build outputs (especially all the .img
s under out/target/product/generic_x86
), here is what I did to load the self-built system image on Mac's emulators:
- Copy
system-qemu.img
to<android_sdk>/system-images/android-29/google_apis/x86
on the MacBook. Then renamesystem-qemu.img
tosystem.img
(You can delete the originalsystem.img
or just give it another name). - Copy
VerifiedBootParams.textproto
to<android_sdk>/system-images/android-29/google_apis/x86
on the MacBook. Also remember to delete or rename the original one before copying. I guess it has something to do withvbmeta.img
, which is used to verifysystem.img
. Without this file, your emulators cannot launch because of verification failure. Refer here for more details.
Just compiled AOSP, do I need AVD to run 'emulator'?
Bellow are the commands that successfully ran in my machine. Hope it may help you solving the issue.
$ export USE_CCACHE=1
$ ccache -M 10G
$ . build/envsetup.sh
$ set_stuff_for_environment
$ lunch full-eng
$ make -j16
$ emulator
to get the system.img to rebuild, you need to remove the following files/directories:
out/target/product/generic/obj/PACKAGING/
out/target/product/generic/system.img
Then simply repeat:
$ make -j16
$ emulator
Related Topics
See Android Recent Task Executed by the User
The Specified Child Already Has a Parent. You Must Call Removeview() on the Child's Parent First
Ndk: How Include *.So Files in Androidstudio
Listview Items Are Not Clickable. Why
Checking My App Version Programmatically in Android Market
How to Detect If Any of My Activity Is Front-Most and Visible to User
Mpandroidchart - Adding Labels to Bar Chart
Speed Up 'Navigation Drawer' Animation Speed on Closing
What's the Purpose of Item-Id's in Android Listview Adapter
What Is the Real World Accuracy of Phone Accelerometers When Used for Positioning
Retrieve Contact Phone Number from Uri in Android
Android Marshmallow: Changing Permissions at Run Time Crashes App
Using the "Animated Circle" in an Imageview While Loading Stuff