Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 717
joaolell Avatar asked Sep 18 '17 05:09

joaolell


Video Answer


1 Answers

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/avdmanager 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

like image 159
Radost Avatar answered Nov 04 '22 17:11

Radost