I use liunx (UBUNTU) as an example:
1. Create an SD card image file
1) Open the terminal to enter the android SDK directory tools directory (such as my path is/home/XXX/android_install/android-sdk-linux_x86/tools );
2) Run mksdcard creation: root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/tools # mksdcard 256 m sdcard. img
The first parameter is the size of the sdcard to be created (determined by the size), and the second parameter is the name of the sdcard.
2. Import files to sdcard
1) Start the simulator through a terminal
Xxx @ xxx :~ /Android_install/android-sdk-linux_x86/tools $. /emulator-AVD android2.3.3 (here is the name of the AVD you want to start)-sdcard. IMG (this is the SD image file you just created)
2) Open the terminal to go to The toolsplatform-tools directory of the android SDK directory (for example, my path is root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/platform-tools #),
Then execute ADB push 111.mp4/sdcard/. If "667 KB/s (20998944 bytes in 30.716 s)" appears, the copy is completed.
3) after the installation is complete, run the ADB shell command to access the device and view the directory. The directory of the sdcard contains the file pushed in. The terminal is as follows:
Root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/platform-tools # ADB Shell
#
#
# Ls
Acct
Cache
Config
D
Data
Default. Prop
Dev
Etc
Init
Init. Goldfish. RC
Init. RC
MNT
Proc
Root
Sbin
Sdcard
Sys
System
Ueventd. Goldfish. RC
Ueventd. RC
Vendor
# Cd sdcard
# Ls
111.mp4
Android
Dcim
Lost. dir
#
4)my simulator did not find 111.mp4 which I just pushed in to gallery. I restarted the simulator (re-run 1) to find video in Gallery. But I was prompted that the video could not be played.
An error occurred while playing the file.
Summary: in short, the purpose of simulating the SD card is achieved. If you test the push image, you can browse the image normally in the gallery. For video playback, I will try another one.