简体   繁体   English

是否可以将文件放在 Android AVD 的“下载”文件夹中?

[英]Is it possible to put a file in 'Downloads' folder in Android AVD?

My app needs to configure settings for the user by reading from a one-time user profile config file at Downloads folder (when the app is run for the 1st time).我的应用程序需要通过从下载文件夹中的一次性用户配置文件配置文件中读取来为用户配置设置(当应用程序第一次运行时)。 I cannot figure out where to put that test config file in the Studio AVD emulated device.我不知道在 Studio AVD 模拟设备中将该测试配置文件放在哪里。 I tried created a 'test' folder in the Downloads folder in AVD device, and thought it might show up somewhere in the .android/ where AVD devices seem to be.我尝试在 AVD 设备的 Downloads 文件夹中创建了一个“test”文件夹,并认为它可能会出现在 .android/ 中 AVD 设备似乎所在的位置。 But, can't find nothing..但是,什么都找不到。。

Is it possible to put a file in AVD for test & use by the app?是否可以将文件放入 AVD 以供应用程序测试和使用?

Yes,just drag your file into AVD window,it will be copied to Downloads folder automatically.是的,只需将您的文件拖到 AVD 窗口中,它就会自动复制到下载文件夹中。

Or you can use adb command to do that like following picture或者您可以使用 adb 命令来执行此操作,如下图所示adb 将文件推送到 avd

In Android Studio, select the Device File Explorer Window (usually bottom right).在 Android Studio 中,选择设备文件资源管理器窗口(通常在右下角)。 Make sure the Device you want is selected at the top in the dropdown.确保在下拉列表的顶部选择了您想要的设备。 In the directory tree find your Downloads folder (or any folder you like), right-click and select Upload... Then you can navigate to the file you want to upload to your device.在目录树中找到您的下载文件夹(或您喜欢的任何文件夹),右键单击并选择上传... 然后您可以导航到要上传到设备的文件。

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

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