Add a file directly to the SD card of the simulator in ddms. If an error occurs, the following error occurs:Failed to push xxxxx.txt on emulator-: Read-Only file system error, because your sdcard permission is insufficient and you need to create an sdcard directly.
I. First create an sdcard. The name of the sdcard I created is sdcard. IMG (the name is random and ends with the name of the IMG extension)
Enter the DOS to point to the directory e: \ android-sdk_r10-windows \ Android-SDK-Windows \ tools (this is the installation of Android SDK files, configure this environment variable is not needed)
Input mksdcard-l sdcard 100 m E: \ sdcard. IMG in DOS (where can this file be stored)
Explanation: 1. The sdcard command can use three sizes: byte, K, and M. If only a number is used, bytes are used. It can be followed by K, for example, 262144 K, or 256 m.
2. The Virtual File Created by sdcard is at least 8 Mb. That is to say, the simulator only supports Virtual files larger than 8 Mb.
3. The-l command line parameter indicates the volume label of the virtual disk. This parameter does not exist.
4. Suffix of the Virtual File. img
Input mksdcard help in DOS.
II,After creating the sdcard, We need to load the sdcard in the simulator.
Window-> AVD Manager-select the simulator you are using-> Edit
Select File in the SD card option, select the newly created sdcard. IMG, and click Edit AVD to save the configuration.
3. Add files to the sdcard of the simulator. (Note: restart the simulator)
4. After restarting the simulator, find Dev tools in the simulator and start it. Then, find and run the media repository to scan the newly added Files. "finished" is displayed and you can exit, at this time, the added file can be used (for example, MP3 file, then the music player can find it ).