gpt4 book ai didi

android - 如何为 Jellybean (API 17) 创建一个有效的 AVD?

转载 作者:IT老高 更新时间:2023-10-28 22:22:58 26 4
gpt4 key购买 nike

我尝试使用以下过程在 Kubuntu 17.04 中为 Jellybean (API 17) 创建一个 AVD:

  1. 从 Android Studio 启动 AVD 管理器

  2. 点击“创建虚拟设备”按钮:

    enter image description here

  3. 选择 Nexus 4 硬件配置文件:

    enter image description here

  4. 点击“下一步”

  5. 点击“x86 Images”标签并选择“Jelly Bean/17/x86/Android 4.2 (with Google APIs)”图片:

    enter image description here

  6. 点击“下一步”

  7. 保留默认设置:

    enter image description here

  8. 点击“完成”

现在,由于 Ubuntu 17.04(及其衍生版本)的一个不幸问题,无法通过单击其条目旁边的播放按钮直接启动模拟器。 (单击它什么也不做。)相反,我必须从终端启动模拟器:

$ cd ~/Android/Sdk/tools
$ LD_PRELOAD='/usr/$LIB/libstdc++.so.6' ./emulator -avd Nexus_4_API_17

模拟器启动并出现主屏幕:

enter image description here

但是,与之交互会立即表明存在问题。相机显示错误:

enter image description here

点击设置应用中的“存储”会导致设置应用崩溃。

我做错了什么,我该如何解决?


编辑:我点击“显示高级设置”并确认确实要创建 SD 卡:

enter image description here

我也确认文件~/.android/avd/Nexus_4_API_17.avd/sdcard.img.qcow2存在。


编辑:我按照相同的程序创建了 Kit Kat AVD(使用 Nexus 5 硬件配置文件),但问题存在。 SD 卡按预期工作。


编辑:我尝试使用 mksdcard 手动创建 SD 卡镜像:

mksdcard -l TEST 100M sdcard.img

...然后直接传给模拟器:

emulator -sdcard sdcard.img -avd [...]

...但这并没有什么不同。

但是,在打开设备上的根终端(使用 adb shell)并运行 mountdf 命令后,我发现了一些有趣的东西:

# mountrootfs / rootfs ro,relatime 0 0tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0devpts /dev/pts devpts rw,relatime,mode=600 0 0proc /proc proc rw,relatime 0 0sysfs /sys sysfs rw,relatime 0 0tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0/dev/block/vda /system ext4 ro,relatime,data=ordered 0 0/dev/block/vdb /cache ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0/dev/block/vdc /data ext4 rw,nosuid,nodev,noatime,errors=panic,data=ordered 0 0# dfFilesystem             Size   Used   Free   Blksize/dev                   757M    68K   757M   4096/mnt/secure            757M     0K   757M   4096/mnt/asec              757M     0K   757M   4096/mnt/obb               757M     0K   757M   4096/system                532M   349M   183M   4096/cache                  60M    40K    60M   4096/data                    1G    75M     1G   4096

看起来好像没有挂载 SD 卡,因为上面的输出中缺少 /dev/block/vdd 并且没有一个分区的容量为 100M。

最佳答案

经过一番研究,我最终得到了一个答案:JellyBean 太旧,无法在最近的模拟器上使用。

如果你想继续使用这个系统并且想同时使用 sd 卡,这对你来说是一个很好的解决方法。

手动启动模拟器:

cd ~/Android/Sdk/emulator
LD_PRELOAD='/usr/$LIB/libstdc++.so.6' ./emulator @Nexus_4_API_17 -verbose -engine classic

注意 -engine classic 它将使用内核 kerne-qemu 而不是新的 qemu2< 加载旧的/经典的 qemu/em> 带有内核 kernel-ranchu(可用选项有:autoclassicqemu2)

关于android - 如何为 Jellybean (API 17) 创建一个有效的 AVD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43923836/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com