SD card content management in Android simulator Environment

Source: Internet
Author: User

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 .?
12 mksdcard 256M sdcard.imgemulator -avd 2.2 -sdcard 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.

?
12 adb push E:/images/test.jpg /sdcard/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.

?
12 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 \):

?
1 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:

?
1234 adb shellcd /sdcardmkdir imagesexit

To export the entire folder, run the following command:

?
1 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:

Author: · Feng xinzi ·
Source: http://www.cnblogs.com/lingcooler
The copyright of this article is shared by the author and the blog. You are welcome to repost this article, but you must retain this statement without the author's consent. Otherwise, you will be entitled to pursue legal liability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.