简体   繁体   English

Android 模拟器内部存储在哪里

[英]Where is Android Emulator Internal Storage

I have an error due to the contents of a file stored in internal storage on my Android Emulator.由于存储在 Android 模拟器内部存储中的文件内容,我遇到了错误。 (I wrote it to file). (我把它写到文件中)。 Is there a way I can view the internal storage used by my app in windows?有没有办法可以在 Windows 中查看我的应用程序使用的内部存储?

I've searched through my whole project folder, sdk, workspace etc and cant find anything.我搜索了我的整个项目文件夹、sdk、工作区等,但找不到任何东西。 I saw someone in another question say it was in the /data folder, but i dont know where to look for that either.我在另一个问题中看到有人说它在 /data 文件夹中,但我也不知道在哪里查找。

Thanks谢谢

If you want to view the folder/file structure of the running emulator, you can do that with the Android Device Monitor which is included with the SDK.如果您想查看正在运行的模拟器的文件夹/文件结构,您可以使用 SDK 中包含的 Android 设备监视器来执行此操作。

Specifically, it has a File Explorer, which allows you to browse the folder structure on the device.具体来说,它有一个文件资源管理器,可让您浏览设备上的文件夹结构。 It also has buttons which give you the adb push/pull functionality but from a GUI if this is easier for you to use.它还具有为您提供 adb 推/拉功能的按钮,但如果这对您更容易使用,则来自 GUI。

In Android Studio on Mac you can go to View -> Tool Windows -> Device File Explorer .在 Mac 上的 Android Studio 中,您可以转到View -> Tool Windows -> Device File Explorer Here you can use a finder-like structure.在这里,您可以使用类似 finder 的结构。

They are stored in an img file inside the avd directory.它们存储在 avd 目录内的 img 文件中。 If you are using Linux you can mount the img file via:如果您使用的是 Linux,您可以通过以下方式挂载 img 文件:

sudo mount -o loop ~/.android/avd/<youremulator>/sdcard.img <mountpoint>

Not sure if there is a way in Windows or Mac to view the contents of the img since they are either in ext3, ext4, or yaffs file system format (depending on what you are emulating) and windows doesn't easily support those file systems.不确定在 Windows 或 Mac 中是否有办法查看 img 的内容,因为它们是 ext3、ext4 或 yaffs 文件系统格式(取决于您正在模拟的内容)并且 Windows 不容易支持这些文件系统.

Your best bet is to use adb to copy the file directly out of the emulator while it is running as shown in adb --help:最好的办法是使用 adb 在模拟器运行时直接从模拟器中复制文件,如 adb --help 所示:

adb pull <remote> [<local>]  - copy file/dir from device

In Android Studio 3.2 and later you can access a device's internal storage by using the menu item在 Android Studio 3.2 及更高版本中,您可以使用菜单项访问设备的内部存储

View -> Tool Windows -> Device File Explorer

See this article for details:https://developer.android.com/studio/debug/device-file-explorer详情请参阅这篇文章:https ://developer.android.com/studio/debug/device-file-explorer

...and this one to find out where the other components of Android Device Monitor ended up: https://developer.android.com/studio/profile/monitor ...还有这个是为了找出 Android Device Monitor 的其他组件在哪里结束: https : //developer.android.com/studio/profile/monitor

In Android N emulator you can easily get access Internal Memory.Android N模拟器中,您可以轻松访问内部存储器。

Go to Emulator:进入模拟器:

Settings -> Memory -> Internal Storage -> Others设置 -> 内存 -> 内部存储 -> 其他

Then a pop up will open.然后会打开一个弹出窗口。 Click on explore .点击explore Then you will get access of Internal Storage.然后您将可以访问内部存储。

在 Android Studio 4.1 及更高版本中,您可以使用菜单项访问设备的内部存储

View -> Tool Windows -> Device File Explorer -> storage 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM