問題描述
我下載了一個第三方ROM,我想先在模擬器上運行,然后再刷入手機.以下是cm-11-20140911-NIGHTLY-p3110.zip
的內容:
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/
我使用腳本 unpack-bootimg.pl
解壓了 boot.img
并得到 boot.img-kernel
和 boot.img-ramdisk.cpio.gz.
然后我使用 make_ext4fs
重新打包系統并得到 system.img
.
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
.
我創建了一個 AVD 并執行:
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
但我什么都沒有,模擬器屏幕只是黑色的.adb -s emulator-5554
沒有日志消息.
but all I got is nothing, the emulator screen is just black. There is no log message from adb -s emulator-5554
.
現在我很困惑:
- 第三方ROM可以通過模擬器測試嗎?
- 我做對了嗎?
推薦答案
是的,為什么不呢.
我們可以在Android AVD上刷第三方ROM.但首先你必須知道以下幾點:
We can flash a third-party ROM on Android AVD. But first you must know the following things:
1.Android 模擬器本身就是一個設備,就像你的 Moto G 或 Xperia
1. The Android Emulator is itself a device, like your Moto?G or Xperia
<強>2.每個 ROM 都是特定于設備的(支持特定于設備的內核)
(在許多網站/博客上,您得到的信息是您必須從 .androidavdavdname.avd 替換 system.img 文件,但這在技術上是不正確的,因為您還需要 ramdisk.img.)
(on many sites/blogs you got information like you have to replace system.img file from .androidavdavdname.avd, but it is technically incorrect, because you also require ramdisk.img.)
為此,您需要通過下載特定的存儲庫來創建自己的 AOSP 存儲庫,并且必須構建自己的 .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)
- 您可以通過兩種方式做到這一點:
從位置 .androidavdavdname.avd
構建您自己的 AOSP.之前......在午餐"中制作選擇目標為:模擬器(如:genericX86),即生成所有模擬器特定的.img文件
Build your own AOSP. Before... make in "lunch" select target as: Emulator (like: genericX86), i.e., generate all emulator specific .img files
我嘗試了很多東西.這有點關鍵,但很有趣.以下鏈接可能會對您有所幫助:
在模擬器上運行你的 ROM (鏈接.嘗試 這個,來自archive.org).
To run your cooked ROM on Emulator (link down. Try this, from archive.org).
創建 AOSP 項目
這篇關于在 Android 模擬器上運行自定義 ROM的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!