有没有办法挂载 Android .img 来访问 AVD(Android 虚拟设备)内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1831440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a way to mount Android .img to access the AVD (Android Virtual Device) contents?
提问by Artem Russakovskii
I feel a bit blind developing on an emulator for Android and not being able to see the file system on the AVD (.img).
我觉得在 Android 模拟器上开发有点盲目,无法在 AVD (.img) 上看到文件系统。
Is there a way to mount it in Windows or Linux, so that I could at least see the file listing and maybe contents?
有没有办法在 Windows 或 Linux 中安装它,这样我至少可以看到文件列表和内容?
Bonus if it's mounted with write permissions as well.
如果它也安装了写入权限,则奖励。
Thank you.
谢谢你。
采纳答案by Ryan Olson
You can just mount the device in Linux:
你可以在 Linux 中挂载设备:
sudo mount -o loop ~/.android/avd/<myvirt>/sdcard.img <destdir>
回答by Mads Kristiansen
How about "adb shell"?
“adb shell”怎么样?
This will give you a root shell (on the emulator)..
这会给你一个 root shell(在模拟器上)。
回答by Alan
回答by Marco Gasparetto
For MacOS X users:
对于 MacOS X 用户:
$ hdiutil attach ~/.android/avd/Samsung_Nexus_S.avd/sdcard.img
回答by Stefan Malacu
Another option would be to use the File Explorer in DDMS (Eclipse SDK), you can see the whole file system there and download/upload files to the desired place. That way you don't have to mount and deal with images. I tried mounting and it's cumbersome, for example if the emulator is running you can't do it. Plus you would need to mount each image if you want to see all contents.
另一种选择是使用 DDMS (Eclipse SDK) 中的文件资源管理器,您可以在那里看到整个文件系统并将文件下载/上传到所需的位置。这样您就不必安装和处理图像。我尝试安装,但很麻烦,例如,如果模拟器正在运行,您就无法安装。另外,如果您想查看所有内容,则需要安装每个图像。
回答by Stefan Endrullis
Yes, they can be mounted. Under Ubuntu you can mount sdcard.img via vfat and system.img and userdata-qemu.img via yaffs2. See also: "Whats Android file system ??".
是的,它们可以安装。在 Ubuntu 下,你可以通过 vfat 和 system.img 挂载 sdcard.img,通过 yaffs2 挂载 userdata-qemu.img。另请参阅:“什么是 Android 文件系统?” .
Note that the file system yaffs2 is not included in the standard Ubuntu kernel. Thus, in case of Ubuntu, you have to build your own kernel with yaffs2 support before you are able to mount the system.img and the userdata-qemu.img. Alternatively, you can also take a look at the yaffs2utilswhich allow you to extract files from yaffs2 images or to create new image files. The advantage is that you do not have to build your own kernel for using these tools.
请注意,文件系统 yaffs2 不包含在标准 Ubuntu 内核中。因此,在 Ubuntu 的情况下,您必须使用 yaffs2 支持构建自己的内核,然后才能挂载 system.img 和 userdata-qemu.img。或者,您还可以查看yaffs2utils,它允许您从 yaffs2 图像中提取文件或创建新的图像文件。优点是您不必为使用这些工具构建自己的内核。