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

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

    I did the following steps to create an external sdcard Image

    Step 1: Navigate to your android sdk directory and to the following directory inside it.

    /{your_androidSdk_location}/Android/sdk/emulator

    Step 2: Ensure that there is a executable file named mksdcard.

    Step 3: Create another directory to store the image file(.img file) that is going to be created in the next step. Lets call this directory as image_dir

    Step4: Execute the following command

    ./mksdcard -l mylabel 1024M image_dir/sdcard.img
    

    Now the .img file would have been created.

    Step 5: Now edit your emulator in the AVD manager and select Advanced Settings , under the Memory and Storage section select external file radio button for Sd Card and choose the .img file that was created in step 4.

    Happy emulated Storage

提交回复
热议问题