【问题标题】:Running the modifed Goldfish kernel on Android from Source从 Source 在 Android 上运行修改后的 Goldfish 内核
【发布时间】:2016-04-09 07:37:54
【问题描述】:

我正在尝试通过加载金鱼内核以及我的一些配置更改来从 Android 源运行模拟器。虽然我发现了很多关于此的问题,但找不到我的答案。 1.我下载了android源码。 2. 我也成功构建了我的金鱼内核。现在我可以在 /goldfish/arch/arm/boot 文件夹中看到 zImage。 在此之后,我尝试通过参考很多类似的问题来运行这个模拟器。 Building Android from source - emulator and AVDsRunning emulator after building Android from sourceHow to compile android goldfish 3.4 kernel and run on emulator。但不幸的是没有解决我的问题。当我尝试使用以下命令运行模拟器时:

./emulator -debug init -kernel Thepath/goldfish/arch/arm/boot/zImage -avd firstAvd -wipe-data

我收到未找到 AVD 的错误消息。然后我找到了这个博客,https://yaapb.wordpress.com/2012/09/22/build-a-custom-android-emulator-image/,它说首先通过以下命令从源代码树中创建模拟器:

$ source build/envsetup.sh
$ lunch full-eng
$ make -j4
$ emulator -wipe-data &

然后用我修改过的内核运行模拟器,我需要运行:

$ cd ${ANDROID_BUILD_TOP}
$ emulator -kernel ~/workspace/android/goldfish/arch/arm/boot/zImage -wipe-data &

虽然我正在尝试这样做,但使用 make 命令创建模拟器的过程需要数小时。到现在为止的 90 分钟内达到 7%。所以同时我想知道是否有人可以告诉我要使用我的内核运行模拟器,我是否需要首先从源代码创建一个模拟器?另外,我在 android 源代码树中找不到 system.img、ramdisk.img 文件。是正常的还是我创建模拟器的时候弄的?

**

编辑

** 我还想知道我是否可以在没有 make -j4 的情况下运行模拟器。 Android 源代码树还包括 SDK。我可以从 SDK 运行模拟器吗?如果是,如何?谷歌官方文档说从 sdk 中的 /tools 文件夹运行以下命令。但是sdk文件夹中没有tools文件夹。

【问题讨论】:

    标签: android android-emulator android-source android-kernel


    【解决方案1】:

    构建源代码后,您不应再次运行构建过程以使用模拟器。只需转到包含 AOSP 代码的文件夹并运行以下命令:

    $ cd ${ANDROID_BUILD_TOP}
    $ source build/envsetup.sh
    $ emulator -kernel ~/workspace/android/goldfish/arch/arm/boot/zImage -wipe-data &
    

    命令source build/envsetup.sh 将向您的shell 添加额外的命令,您应该能够运行模拟器而无需从头开始构建它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 2016-11-09
      • 2014-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多