How to create SD card to use in Android Studio's emulator?

前端 未结 6 2084
抹茶落季
抹茶落季 2021-02-20 09:32

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

6条回答
  •  无人及你
    2021-02-20 10:07

    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.

    Example Create the mySdCardFile.img disk image:

    mksdcard -l mySdCard 1024M mySdCardFile.img
    

    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
    

    Reference :

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

提交回复
热议问题