如何将SD卡添加到genymotion? [英] How to add an SD card to genymotion?

查看:197
本文介绍了如何将SD卡添加到genymotion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在genymotion设置->存储中,只有内部存储,没有SD卡.

In genymotion settings->storage there is only the internal storage, no SD card.

是否也可以使用SD卡?

Is there a way to have a SD card also?

推荐答案

Genymotion中已经有一些SD卡(外部)存储的模拟可能对您有用,具体取决于您要执行的操作.尽管设置"->存储"没有像您期望的那样单独显示为外部存储",但是Genymotion确实模拟了外部存储.在那里存储的文件大小将反映在内部存储"下的按设置-存储"中显示的总数中.

There's already some emulation of SD card (external) storage in Genymotion that might work for you, depending on what you're trying to do. Although Settings->Storage doesn't show it separately as External Storage like you might expect, Genymotion does emulate external storage. The size of files stored there will be reflected in the totals shown under Internal Storage by Settings-Storage.

在Genymotion中运行,使用Environment.getExternalStorageDirectory().getPath().getAbsolutePath()的应用将返回/storage/emulated/<userId>,如果该应用以所有者身份运行,则userId = 0,如果该应用以所有者身份运行,则为10、11、12等.正在以其他用户或受限制/受管理的配置文件的身份运行. Android框架实际上为您将其映射到/mnt/shell/emulated/<userId>,这就是为什么如果您使用外壳戳来找不到/storage/emulated/<userId>的原因.

Running in Genymotion, an app using Environment.getExternalStorageDirectory().getPath() or .getAbsolutePath() will get back /storage/emulated/<userId>, where userId=0 if the app is running as Owner, and 10, 11, 12, etc. if the app is running as another user or restricted/managed profile. The Android framework actually maps this for you to /mnt/shell/emulated/<userId>, which is why you won't find /storage/emulated/<userId> if you use a shell to poke around.

路径/sdcard/mnt/sdcard是到/storage/emulated/legacy的符号链接,该链接基本上是所有者的存储.不要在您的应用程序中使用它们,因为它们可能不存在于每个地方,并且/或者如果不以所有者身份运行,则您的应用程序可能无法访问它们.他们只是在支持旧的硬编码应用.

The paths /sdcard and /mnt/sdcard are symlinks to /storage/emulated/legacy, which is basically the Owner's storage. Don't use these in your apps, since they might not exist everywhere and/or your app might not have access to them if not running as Owner. They are just there to support legacy hardcoded apps.

不确定所要执行的操作,值得一提的是Genymotion现在支持VirtualBox共享文件夹,该文件夹将显示在VM内部的/mnt/shared下.查看其 Google+帖子以获取说明.

Not being sure what you're trying to do, it's probably also worth mentioning that Genymotion now supports VirtualBox shared folders which will appear under /mnt/shared inside your VM. Check their Google+ post for instructions.

这篇关于如何将SD卡添加到genymotion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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