Android simulator SD card Image File Usage

Source: Internet
Author: User
1. mksdcard command
Run cmd to enter the SDK tools directory and run the mksdcard command. The following help information is displayed:

We can see that sdcard image supports the FAT32 format. Usage: mksdcard [-l label] <size> <File> is the main parameter.
  • -L the disk is followed by the volume label. For example, G indicates g disk;
  • Size indicates the size, measured in KB and MB;
  • File indicates the generated SD image file name, such as android_sdcard_image.
  • 2. Simulate SD steps for Simulator
    (1) Create an SD card image file
    Open CMD and enter the following command:Mksdcard 1024 M sdcard. img, The command willCurrent DirectoryGenerate an sdcard. imgfile, which is the simulator's SD card image file. 1024m indicates that the SD card has a capacity of 1 GB, and K and M can also be used as units. K and m must be capitalized. At present, simulator supports 8 m ~ Gb sd card.
    (2) Simulator loads the SD card image file
    You have created an SD card image file, but you have created a file that cannot be directly used in the simulator. You can see the SD card in the simulator in either of the following ways:

  • In cmd, the command is as follows: emulator-sdcard E: \ sdcard. img
  • Run as --> RUN configurations --> target --> aditional emulator command line options:-sdcard <SD Image File Name>, for example:

  •  
    3. Import/Export files to the SD card

  • In cmd: ADB push <file path + File Name>/sdcard/<File Name>. For example

  • This command will test the test.txt file under the current directory to the sdcard, and the file name will not change. The first test.txt is the path of the local file, and sdcard/test.txt is the name of the target sdcard image (sdcard must remove the suffix ).

  • In eclipse, perform the following operations: After setting the run command parameters, run an application and use the file explorer tool of ddms to import and export files. Open the ddms tool: Open the ddms tool in the eclipse window-> open perspective-> other. On the "file Explorer" tab of ddms, select the sdcard directory to import and export files, for example:

  •  
    4. Use the files in the SD card in the simulator
    After the file is imported, if you want to access it in the simulator, you also need to scan the media file in the dev tools in the simulator, such:

    Note: Dev tools is available only on the simulator or development machine. This menu option is not available on normal Android phones.

    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.