jhhhhhhhhhh
jhhhhhhhhhh

Reputation: 1

how to run android on qemu

I successfully compiled android12 using aosp, but I don’t know how to run it using qemu

qemu-system-x86_64 -enable-kvm -m 2048 -smp 4 -kernel out/target/product/generic_x86_64/kernel-5.10 -initrd out/target/product/generic_x86_64/ramdisk.img -hda out/target/product/generic_x86_64/system.img -net nic -net user,hostfwd=tcp::5555-:5555 -show-cursor -serial mon:stdio -device virtio-gpu-pci -append "console=ttyS0 root=/dev/ram0 androidboot.hardware=goldfish"

This is the command I ran

Upvotes: 0

Views: 1029

Answers (1)

satur9nine
satur9nine

Reputation: 15082

Do you have a specific need to run Android in QEMU and not use the emulator binary included with AOSP in prebuilts/android-emulator/linux-x86_64/emulator?

If so...

  • What command did you use to build AOSP?

  • What error did you encounter when running with QEMU?

  • What version of QEMU are you using?

  • What is your host Linux machine cat /etc/os-release?

Assuming on the other hand you actually just want to start the Android emulator for your build...

You don't need to run QEMU, there is a pre-built emulator binary (based on QEMU) include with AOSP already.

Did you read: https://source.android.com/docs/setup/create/avd ?

As explained there after building AOSP SDK you just need to run the following command:

$ emulator

If you run emulator --help there is a lot of helpful information.

Upvotes: 0

Related Questions