Working with SD cards in the Android emulator

Working with external storage in the Android emulator could be a little tricky and the documentation is not easy to find. I’ll try to give a brief walk through of the steps needed to create a SD card image, mount the image in Linux, put content on it and use it in the emulator.

Creating a SD card image
In both the 1.1 and 1.5 version of the SDK there is a tool called mksdcard located in the SDK Install Dir/tools folder. Simply run

to create a 128Mb SD card with the name my128MbCard.

Mounting a SD card image in Linux
To be able to put content on to the card you can mount the card in Linux. It will then simply appear as a folder in the filesystem.
First make a directory in the /media folder:

Then mount the card as a loopback device:

Adding content to the card
With content we usually mean media content like images and videos. Images and videos are located in a folder called /dcim/Camera. You could of course add any content to the card. When you are done copying your files be sure to umount the card otherwise it will not be usable from the emulator.

Using the card in the emulator
Google added something called Android Virtual Device (AVD) to the SDK 1.5. To create a new AVD using our newly created SDcard image run the following:

Target 2 means that we want to use the 1.5 API features in the device. Now we simply fire up the emulator and start using our content:

More information about the new SDK can be found here: SDK

This Post Has 37 Comments

  1. Thanks for this tutorial!! :) It was very helpful.

  2. What do you do if you don’t have linux?

  3. When I try to mount, it says
    mount: -o loop: option not supported

    what should i do

  4. Hi. It was an useful article. Thanks

  5. Thanks budy!

  6. I figured this out on Windows, in case anyone needs that info. Go to and look for How to create an SD card, store a contact photo, and display the photo on the handset..

  7. Hey,
    For the last steps of creating AVD, Can we use the -sdcard option for the emulator?

    ./emulator -sdcard my128MbCard .


  8. Hay, Thanks buddy steps are working as it is…

  9. Thanks a lot man….it helped me to access the sdcard in linux……i am using the 2.1 version of the SDK……though the last two steps for emulator are not needed if you are using eclipse for developing apps… eclipse go to
    Run->Debug Configurations->Target->Addtional Emulator command line options, type the following

    -sdcard /the path where we have created the my128MbCard/my128MbCard

    once again thanks a lot

  10. Great way to transfer files in an emulator!! I’m using Android 2.1, waiting for the Google I/O conference news! This is wonderful!

  11. thanks. that was helpful

  12. hi

    this is very useful and working well.thank you

  13. very useful paper.. Thank you..
    A question…
    The sdcard format is FAT. Is possible to change this format to ext2 or ext3 format ?
    Thanks in advance!!

  14. Thanks a lot for sharing.

    But i want to make one small application which will check status of my External storage,Add files or pictures into External storge ,and read that data from Gallery folder of my emulator.

    Can u help me to accomplish my app.


  15. I am using Android SDK by Eclipse on windows 7 environment. How can i create folder in somelocation of SD card?

  16. Hi

    Do you know how to make a sdcard with partition in the sdcard?


  17. while creating itself select sd card .its simple.then using file explorer from window->view you can store and retrive data on sdcard!!!!

  18. In OSX, just name the image .iso and type ‘open mycard.iso’ and it will be mounted and available in Finder

  19. Thanks !!!
    I will try it and i wil tell you about the results.

  20. Hi
    If you are using Eclipse it is very easy to create SD card at the time of creating a new virtual device.

  21. Thanks Buddy ! It is working. By the way what is the idea behind mount and unmount ? If anyways we are going to unmount then why mount ?

  22. I didn’t get what I want. so poor service.

  23. I was recommended this web site by my cousin. I’m now not certain whether or not this publish is written by way of him as no one else realize such designated about my difficulty. You’re wonderful! Thanks!

  24. I’m now not certain where you are getting
    your info,however glod topic. I must spend some time learning more or
    understanding more. Thanks for wonderful information I used to be onn the lookout for
    this info ffor my mission.

Leave a Reply

Close Menu