Summary: This article aims to introduce some basic commands for managing the SD card content in the android simulator, and also recommends a more practical tool. Environment used by the author: Windows 7 + Android SDK 2.2 1. Create an SD card and mount it to the simulator to run CMD and CD it...
This article aims to introduce some basic commands on how to manage the SD card content in the android simulator, and also recommends a more practical tool. My environment: Windows 7 + Android SDK 2.2 1. Create an SD card and mount it to the simulator. Run CMD and CD it to the Android-SDK \ tools \ directory. Enter the following command to create and mount the SD card to the simulator. In the mksdcard parameter, the SD card size unit can be K or M (uppercase is required), and a file named sdcard. IMG will be created in the tools directory. You can mount the SD card and start the simulator by adding-sdcard to the emulator. Mksdcard 256 m sdcard. imgemulator-AVD 2.2-sdcard. img 2. operate a single file By using ADB push, you can add files to the SD card. To modify the file name during push, you only need to modify the second parameter of push to the full path (directory + file name), such as/sdcard/test-0.jpg. Restart the simulator. You can see the newly added content on the SD card. ADB push E:/images/test.jpg/sdcard/test-0.jpg To extract test.jpg, use the ADB pull command. The second parameter is the local hard disk address. If you do not want to change the name, you only need to enter the directory address (\ cannot be added). If you need to change the name, you just need to enter the complete path of the file. ADB pull/sdcard/images/test.jpg E: \ tmpadb pull/sdcard/images/test.jpg E: \ TMP \ test-0.jpg 3. Operate the entire folder To add all the contents of a folder on the hard disk to the SD card, run the following command (note that \ is not available after pic \): ADB push E: \ Android \ PIC/sdcard/images/ This command adds all the contents of the PIC file and its sub-folders to the images directory of the SD card. If there is no images directory under the SD card, you can first create it through the ADB shell, as shown below: ADB shellcd/sdcardmkdir imagesexit To export the entire folder, run the following command: ADB pull/sdcard/images/E: \ TMP 4. winimage-a practical SD card content management tool Feel that the input command is more troublesome, you can use the winimage recommended by the monks (http://www.winimage.com /). With this software, we can manage the content of the SD card as conveniently as Windows Explorer. Its usage is also quite simple, by dragging a file (folder) you can add the content on the hard drive of the PC to the SD card. It should be noted that the SD card will be locked when the simulator is started, and an sdcard will be generated under the tools directory. IMG. in this case, sdcard cannot be opened when winimage is used. imgfile. The following are:
|