mksdcard tool to create a FAT32 disk image that you can load into
emulators running different Android Virtual Devices (AVDs) to simulate the presence
of the same SD card in multiple devices.
mksdcard tool provided in the Android SDK Tools package
is located in
If you don't need a disk image that can be shared
among multiple virtual devices, you don't need to use the
By default, the emulator uses the default image that is generated by and stored with the
active AVD instead.
To use the
mksdcard tool, use the following command:
mksdcard -l label size file
The following table describes the command-line options of
||A volume label for the disk image to create|
An integer that specifies the size of the disk image to create.
If size is a simple integer, it specifies the size in bytes. You can also
specify the size in kilobytes, megabytes, or gigabytes by appending K, M, or G
to size. For example,
|file||The path/filename of the disk image to create relative to the current working directory.|
mySdCardFile.img disk image:
mksdcard -l mySdCard 1024M mySdCardFile.img
Start two emulators with different AVDs. Use the
-sdcard flag to specify the name
and path of the disk image you created:
emulator -avd Pixel_API_25 -sdcard mySdCardFile.img emulator -avd NEXUS_6_API_25 -sdcard mySdCardFile.imgFor more information about the
emulatorcommand and its options, see Start the emulator from the command line.