Android 在 Genymotion 模拟器中添加文件夹/文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22472963/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:01:16  来源:igfitidea点击:

Add folder/files in Genymotion emulator

androidgenymotion

提问by Blu

I want to add folder in my Genymotion emulatorI also tried this questionand follow all instruction but folder is not showing in file manager I also download some images from Googlebut also those not visible in file manager.

我想在我的文件夹中添加文件夹Genymotion emulator我也尝试过这个问题并按照所有说明进行操作,但文件夹未显示在文件管理器中我还从谷歌下载了一些图像,但也下载了文件管理器中不可见的图像。

In my emulator following file manager installed File Managerv 1.0.1 The CyanogenMod Project

在我的模拟器下面的文件管理器中安装了 File Managerv 1.0.1 The CyanogenMod Project

回答by Blu

I solve my problem

我解决了我的问题

First follow this Answer

首先按照这个答案

  • Go to your VirtualBox VM setting / Shared folder tab
  • Add a shared folder with the folder you want to shared, and check the "auto mount" option
  • Start your VM as usual from the Genymotion software
  • Your shared folder is available in the /mnt/shared directory (multiple shared folders are supported)
  • 转到您的 VirtualBox VM 设置/共享文件夹选项卡
  • 将要共享的文件夹添加一个共享文件夹,并勾选“自动挂载”选项
  • 像往常一样从 Genymotion 软件启动您的 VM
  • 你的共享文件夹在/mnt/shared目录下(支持多个共享文件夹)

After that Change Settings of file Manager in Genymotion emulatorchange that to root user so all my folder visible also with Shared folders

之后更改文件管理器的设置,Genymotion emulator将其更改为 root 用户,以便我的所有文件夹也可以在共享文件夹中看到

  • In Genymotion virtual device, run the application "File Manager" and READ the advertisement about "low-privileged mode".
  • Go to "settings" menu from "File Manager"
  • In "general settings", click on "access mode" and activate "Root access" mode
  • Restart File Manager => all directories will be presented
  • 在 Genymotion 虚拟设备中,运行应用程序“文件管理器”并阅读有关“低特权模式”的广告。
  • 从“文件管理器”转到“设置”菜单
  • 在“常规设置”中,点击“访问模式”并激活“Root访问”模式
  • 重新启动文件管理器 => 将显示所有目录

Thanks

谢谢

UpdateIn newer version of genymotionyou can add files/folder by drag and drop. It take some time while adding files in emulator. time depends on file size.

更新在较新版本中,genymotion您可以通过拖放添加文件/文件夹。在模拟器中添加文件需要一些时间。时间取决于文件大小。

Update 2 (Based on @GandhyOnly comment)

更新 2(基于@GandhyOnly 评论)

To make visible in gallery just drag and drop your images files on emulator they stored in download folder after finish transferring files restart same emulator and images will shown in gallery. Or if you don't want to restart emulator then use following command

要在图库中可见,只需将您的图像文件拖放到模拟器上,在完成传输文件后,它们存储在下载文件夹中,重新启动相同的模拟器,图像将显示在图库中。或者,如果您不想重新启动模拟器,请使用以下命令

adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard/

it will rescan images and show them in gallery. For more detail about command see the actual answer here. I didn't check command I use first method just restart emulator

它将重新扫描图像并在图库中显示它们。有关命令的更多详细信息,请参阅此处的实际答案。我没有检查命令我使用第一种方法只是重新启动模拟器

回答by Subrat Behera

Simply drag and droponto the emulator the file that you want to use.

只需要使用的文件拖放到模拟器上即可。

It will be saved in Download folder.

它将保存在下载文件夹中

回答by Ajji

I have a more simpler approach to this . Open your genymotion , and just

我有一个更简单的方法。打开你的 genymotion ,然后

drag and drop the file in the required directory

将文件拖放到所需目录中

I am attaching two screenshots in this regard.I had an app that used pictures, after copying by drag and drop i was able to find pictures in file manager through my app. **

我在这方面附上了两个屏幕截图。我有一个使用图片的应用程序,通过拖放复制后,我能够通过我的应用程序在文件管理器中找到图片。**

Just drag and drop like following

只需拖放如下

** enter image description here

** enter image description here

And you are done enter image description here

你已经完成了 enter image description here

It will be copied to DownloadFolder

它将被复制到下载文件夹

回答by mwaqas01

Simply Drag and drop files from your PC to emulator and after copying data, files will be saved in the DOWNLOADfolder. Remember that to make DRAG and DROPservice working, do not open Genemotion Software by ADMINISTRATOR privileges.

只需将文件从 PC 拖放到模拟器,复制数据后,文件将保存在DOWNLOAD文件夹中。请记住,要使DRAG 和 DROP服务正常工作,请不要以管理员权限打开 Genemotion 软件。

回答by MishaLee

I'm not sure whether you're using SD card or not. In case you do, try to look in this folder through DDMS file explorer in Eclipse:

我不确定您是否使用 SD 卡。如果您这样做,请尝试通过 Eclipse 中的 DDMS 文件资源管理器查看此文件夹:

mnt/shell/emulated/0/MyFiles

mnt/shell/emulated/0/MyFiles

This is where my files go when using standard SD card reference in my code:

这是在我的代码中使用标准 SD 卡参考时我的文件所在的位置:

File sdCard = Environment.getExternalStorageDirectory();
File directory = new File (sdCard.getAbsolutePath() + "/MyFiles");