在 Android 模拟器上运行自定义 ROM [英] Run custom ROM on Android Emulator

查看:103
本文介绍了在 Android 模拟器上运行自定义 ROM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一个第三方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-kernelboot.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 GXperia

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)

  • 您可以通过两种方式做到这一点:
  1. 从位置 .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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆