How to sort out the sdcard operation skills of the Android Simulator

Source: Internet
Author: User

When developing an image browser based on SD card, you need to perform some operations on the SD card in the Google Android simulator. You can view the operations on the Internet and summarize them as follows to avoid forgetting:

1. Create an SD card image file on the hard disk:
Go to the toolssubdirectory under the Android sdkdirectory, find the mksdcard.exe file, enter dos, and run
Mksdcard-l sdcard 512 M/your_path_for_img/sdcard. img
In this way, a m SD card image file is created in the/your_path_for_img/directory;
2. Start the Android simulator with sdcard in two ways:
1)/after starting the simulator, use
Emulator-avd avd_name-sdcard/your_path_for_img/sdcard. img
The command is associated with the SD card. The emulator command is in the tools subdirectory under the Android SDK directory;
Note: This method must be executed every time the simulator is started before the data in sd can be used.
2)/when creating a simulator, in the SD Card in the Create new Android Virtual Device (AVD) dialog box, select "File"-"Browse" to directly select the created SD Card image File;
Note: The advantage of this method is that the SD card has been mounted after the simulator is started. You can directly use the data in the SD card.
3. Add local files to sdcard (start the simulator and mount sdcard)
... \ Android_SDK directory \ tools> adb push... \ filefolder/sdcard
".. \ Filecard" is the local file, and "/sdcard" is the path of sdcard in the simulator;
Note: After adding a file, start Dev Tools on the simulator and run the Media repository. "finished" is displayed to exit. The purpose is to update the database.
4. copy the file in the SDK card of the simulator to the local machine:
... \ Android_SDK directory \ tools> adb pull/sdcard/file... \ save_dir
"/Sdcard/file" is the local directory of the file to be copied, and "... \ save_dir" stores the file;
5. Browse the SD card file. You can use adb shellin dos to access shelland download the relevant file browser .apk to view it after installation. Www.2cto.com

6. In the simulator, run the following command to unplug the SD card:
Adb shell sdutil mount/sdcard
Adb shell sdutil unmount/sdcard card

7. How to directly operate the files in the SD card image:

Use UltraISO to open the sdcard. imgfile, drag and drop the file or folder, and save it! Chinese file names are also supported!

 

From the column of michaelpp

Related Article

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.