如何在Android Studio的模拟器中创建SD卡? [英] How to create SD card to use in Android Studio's emulator?

查看:1727
本文介绍了如何在Android Studio的模拟器中创建SD卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将MP3文件下载到Android Studio中的SD卡然后阅读它们,首先,我如何为我的模拟器创建SD卡?其次,我该如何添加文件?我是初学者,所以欢迎逐步解释。

I need to download mp3 files to an sd card in Android Studio and then read them, firstly, how can i create an SD card for my emulator? Secondly, how can I add files to it? I'm a beginner so a step by step explanation would be welcome.

推荐答案

使用mksdcard工具创建FAT32磁盘映像您可以加载到运行不同Android虚拟设备(AVD)的模拟器中,以模拟多个设备中存在相同的SD卡。如果您不需要可在多个虚拟设备之间共享的磁盘映像,则无需使用mksdcard命令。默认情况下,模拟器使用由活动AVD生成并存储的默认图像。

Use the mksdcard tool to create a FAT32 disk image that you can load into emulators running different Android Virtual Devices (AVDs) to simulate the presence of the same SD card in multiple devices. If you do not need a disk image that can be shared among multiple virtual devices, you do not need to use the mksdcard command. By default the emulator uses the default image that is generated by and stored with the active AVD instead.

示例
创建 mySdCardFile。 img 磁盘映像:

mksdcard -l mySdCard 1024M mySdCardFile.img

启动两个具有不同AVD的仿真器。
使用 -sdcard 标志指定您创建的磁盘映像的名称和路径。

Start two emulators with different AVDs. Use the -sdcard flag to specify the name and path of the disk image you created.

emulator -avd Pixel_API_25 -sdcard mySdCardFile.img
emulator -avd NEXUS_6_API_25 -sdcard mySdCardFile.img

参考:

https://developer.android.com/studio/command-line/mksdcard.html

这篇关于如何在Android Studio的模拟器中创建SD卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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