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