Home > Tutorials > Create and use emulated SD Card

Create and use emulated SD Card


SD card is an external storage for mobile device, by default, it is not available in Android Emulator. What you need  to do is to create an emulated SD card for your Android Emulator.

1. Creating SD Card

Access to your Android SDK Tools folder and use command “mksdcard” in order to create one.

By default installation on Windows, the Tools folder should be here:

C:\Program Files\Android\android-sdk\tools

Using following syntax to create your desired SD Card

mksdcard [memory size] [output file]

For example, I’d like to create a SD card with 256 MB in memory and put the files in C:\Personel\AndroidNewbie\SDCard with file named “sdcard_dev.iso“, I do like this:

mksdcard 256M C:\Personel\AndroidNewbie\SDCard\sdcard_dev.iso

2. Using SD Card

You’ve done creating your desired SD Card, now you need it to be used by Android emulator. Open Eclipse, access to your project.

On menu Run -> Run Configurations, click on Android Configuration on the left tree menu, click on tab Target on the right pane. You will see at the bottom: “Additional Emulator Commandline Options” and an Input/Edit box below:

Just type your input sdcard following syntax

-sdcard [sdcard location]

For example, with the SD Card I’ve created above, I type:

-sdcard C:\Personel\AndroidNewbie\SDCard\sdcard_dev.iso

 

SD Card Settings

SD Card Settings

Now just run your emulator, you can access to your created SD Card.

 

Another way to run your Emulator with SDCard:

+ Open AVD Manager, click on the device you want to run with SDCard automatically, click on button Edit on the right menu. A setting dialog appears and just browse to your desired SDCard image:

SD Card Settings

SD Card Settings

 

3. Browse SD Card

There are many ways to browse SD Card, however, I will just tell you two common ways:

a. In Eclipse, open DDMS Perspective, and open File Explorer view, you can browse /sdcard directory.

In this mode, you can drag and drop files.

b. Using commandline, go to adb shell by typing:

adb -e shell

Then access to /sdcard directory by typing:

# cd /sdcard

You can use push/pull from adb shell to put files into sdcard or get files from it.

It’s quite handy-some, isn’t it?

Happy Android!

Cheers,

Pete Houston

About these ads
Categories: Tutorials Tags: , ,
  1. goh
    April 17, 2014 at 4:41 pm

    WHY I Can’t made it :(:(:(
    been try many times but failed!
    could you just make a correct statement let me just copy and paste

  2. ranjan
    January 3, 2014 at 8:47 pm

    nice article.. if we want to mount 2 SD cards ( like one is default one and the other one as mountable removable SD card) as we have now in many android devices, how can we simulate that?

  3. raj mathauda
    April 22, 2013 at 11:44 am

    thank you ………sooooooooooooo much………….

  4. girish
    March 31, 2013 at 5:18 pm

    how to de emulate an sd card. ?

  5. November 13, 2012 at 1:23 am

    Very helpful; thanks.

  6. rinkesh
    August 29, 2012 at 10:50 pm

    here is the solution
    step 1:Open Android Virtual device manager
    step 2:select your emulator
    step 3:edit your emulator
    step 4:must specified size of your sd card 1024MB
    step 5:in hardware option click new set property add sd card support: yes(value)
    step 6:start your emulator, in eclipse window–>showview–>other->android–>file explorer
    step 7->in file explorer open mnt->sdcard and using pushfile button for insert your file and image
    step 8:DONE

    • December 2, 2012 at 10:09 pm

      How to show push file in emulator????

    • Vaibhavi
      June 15, 2013 at 4:07 pm

      Helped me a lot !!!

    • Jagruti
      August 17, 2013 at 12:32 am

      Thank u so much……it was really helpful…

  7. NaIDU
    May 18, 2012 at 2:14 pm

    thanks, ……….it was very helpfull…

  8. dhivya2110
    April 10, 2012 at 12:33 am

    Thanks a lot!!! It was really useful!!!

  9. PML
    February 4, 2012 at 7:10 pm

    Gr8 Help. Thanks

  10. sam
    December 13, 2011 at 10:15 am

    really a nice description…i’m fully enjoyed it.

  11. Mash
    October 25, 2011 at 3:25 pm

    Hey, this was really helpful. Thanks a million!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: