20
votes

I downloaded a third-party ROM, and I want to run it on the emulator first before flash it into the phone. Here is the contents of cm-11-20140911-NIGHTLY-p3110.zip:

 1. boot.img
 2. file_contexts
 3. META-INF/
 4. recovery/
 5. system/

I unpacked boot.img using the script unpack-bootimg.pl and get boot.img-kernel, and boot.img-ramdisk.cpio.gz. Then I repacked the system using the make_ext4fs and got system.img.

I created an AVD and execute:

emulator -system ~/cm11/system_new.img -ramdisk ~/cm11/boot.img-ramdisk.cpio.gz -kernel ~/cm11/boot.img-kernel -avd and442

but all I got is nothing, the emulator screen is just black. There is no log message from adb -s emulator-5554.

Now I am confused:

  • can the third-party ROM be tested by the emulator?
  • Am I doing the right way?
1
This question appears to be off-topic because it is not about programmingPhantômaxx
@Hrundi: only writing no. of lines of code is only programming?Sanket Prabhu
@SanketPrabhu Changing a ROM is a generic system task, not related to programmingPhantômaxx
any updates? :( i am stuck with the same issue (built AOSP from source)Jaroslav Záruba

1 Answers

11
votes

Yeah, why not.

We can flash a third-party ROM on Android AVD. But first you must know the following things:

1. The Android Emulator is itself a device, like your Moto G or Xperia

2. Every ROM is device-specific (supports a device-specific Kernel)

(on many sites/blogs you got information like you have to replace system.img file from .android\avd\avdname.avd, but it is technically incorrect, because you also require ramdisk.img.)

To do this, you need to create your own AOSP repository by downloading the particular repository and have to build your own .img files)

  • You can do it in two ways:
  1. replace files system.img and ramdisk.img from location .android\avd\avdname.avd

  2. Build your own AOSP. Before... make in "lunch" select target as: Emulator (like: genericX86), i.e., generate all emulator specific .img files

I have tried many things. It's a bit critical, but interesting. The following links may help you:

To run your cooked ROM on Emulator (link down. Try this, from archive.org).

To Create AOSP Project