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:
I recommend you to create one profile for each Android version you want to run (so : you just have to change the ID, and create same profile). If you don't, you won't be able to run custom ROMs using other versions of Android (ie your AVD profile is 2.3 and you run a 2.1 custom ROM).
It is also impossible to import a custom ROM of Android into Genymotion, or modify the current ROM, for technical and legal reasons. So, you can't import and use CyanogenMod in Genymotion.
However, the heap size should not be less than 12 MB. o Depending on your computer specs, the recommended ram size is in the range between 512 MB – 1024 MB. Although you can give more ram to the emulator but an actual android device would normally have 512 MB – 1024 MB for ram only.
Go to "Device File Explorer" which is on the bottom right of android studio. If you have more than one device connected, select the device you want from the drop-down list on top. mnt>sdcard is the location for SD card on the emulator. Right click on the folder and click Upload.
Run terminal, go to Android SDK folder/tools/ (if you didn't close your current terminal, you're already in and run this command to run emulator WITH your custom ROM : Wait and enjoy ! (?) First boot is long - it's NORMAL. Just like on a real device, the OS will be cached and will work faster and faster.
If you don't, you won't be able to run custom ROMs using other versions of Android (ie your AVD profile is 2.3 and you run a 2.1 custom ROM). 9.
To run a ROM file for a phone you'd need to change the emulator to emulate the specific hardware of that phone. This is next to impossible without the support of the device manufacturer, and would need to be repeated for each device.
Launch the Android Emulator without first running an app. To start the emulator: Open the AVD Manager. Double-click an AVD, or click Run. The Android Emulator loads. While the emulator is running, you can run Android Studio projects and choose the emulator as the target device.
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)
replace files system.img and ramdisk.img from location .android\avd\avdname.avd
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With