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

前端 未结 6 2190
抹茶落季
抹茶落季 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:20

    I had the same problem. I needed a lot of space for saving images in the emulator. My solution was creating an image sdcard and attach it to emulator. I followed these steps:

    1 ) Create an image of external sdcard:

    ~/Library/Android/sdk/tools/mksdcard -l mySdCard 20G path/mySdCard.img
    

    2 ) Create an emulator with the external sdcard:

    ~/Libarary/Android/sdk/tools/bin/advmanager create avd -n EMULATOR_NAME -k “system-images;android-24;default;x86” -f -c path/mySdCard.img
    

    3 ) I searched for the external storage path with adb shell because the path to push the files is not very intuitive.

    My sdcard path is in storage/15F5-0C07/
    

    4 ) Push the files into external storage path

    ~/Library/Android/sdk/platform-tools/adb push localPath  /storage/15F5-0C07
    

    I wrote all of the steps because I searched a lot for pushing the files into external storage and not into internal storage

提交回复
热议问题