Here’s something that’s come up recent for me as a developer. How do you emulate a SD card on a emulator. Since the upgrade to SDK version 1.5, this has changed. Here’s how its done now (With pictures for extra help
).
- Find out where your AVDs (Android Virtual Devices) are located.
- This can be done by using the command
android list avd- The command android is found within the /tools directory of the SDK you’re using. Set this directory as a global $PATH variable for simplicity as per installation instructions here.
- This will return a list of AVDs and their location
Now that you know where your emulator(s) are, navigate to the avd_name.avd/ folder.- Create the SD Card emulator using the mksdcard command
mksdcard 32M sdcard.img- 16M refers to the card size, and the image will have a name of sdcard.img
- Next time you boot your emulator, there will automatically be a SD Card image.
-
To add files to the SD Card, go to Eclipse and select the DDMS view. From there select your emulator. Click on the file browsing tab. Here you can drag and drop things to the /sdcard/ folder. Enjoy


Pingback: Developer Tip #6: Programmatically Reading and Writing From SD Card | DroidWeb