How to create and use an SD card with the Android emulator

Source: Internet
Author: User

How to create and use an SD card with the Android emulator:

    • Create an SD card image file

      1. Open cmd and go to the tools directory under the Android SDK installation path and enter the following command: Mksdcard 1024M sdcard.img

      2. This command generates an sdcard.img file in the current directory, which is an SD card image file for the Android emulator. 1024M indicates that the SD card has a 1024M size, or 1G capacity. Currently Android supports 8m~128g SD card.

    • Running an emulator with an SD card

      1. Create an SD card image file, just create a file, not directly in the emulator, to load the SD card in the emulator, the method has the following:

        1. Start the emulator with SDcard in cmd

        2. Go to the Tools directory under the Android SDK installation path and run the following command: Emulator-avd name_avd-sdcard sdcard.img. Where NAME_AVD is the name of an existing emulator, SDCARD.IMG is the first step to create an SD card image file.

      2. In eclipse, when creating a new emulator, specify the path to the SD card image file and add support options for the SD card

        1. Open Eclipse, enter: Window->android SDK and AVD manager such as:

        2. At the time of creation, in the SD card column, select File and set it as the path to the SDcard image file.

        3. Click New in the Hardware column and select SD Card surport.

        4. Click Create Avd,ok.

      3. In eclipse, in Run->run configurations ... In the German Target tab of the menu, enter the startup parameters.

    • There are two ways to upload files to this SD card:

      • In cmd, go to the Tools directory under the installation path of the Android SDK and run the command: ADB push E:\test.3gp sdcard/test.3gp

        • The "Read-only file system" may appear when you push, and if this problem occurs, do the following:

      • #emulator-partition-size 256-avd AVD file name

      • #adb remount

      • #adb Push * * *

        • Where E:\test.3gp is the file to be uploaded locally, sdcard/test.3gp is the path uploaded to the SD card.

        • Note: The ADB push computer path simulator path must use "\" in the computer Path, "/" must be used in the emulator path, and the root path of the emulator is read-only.

      • In the Eclipse environment

        1. After setting the command parameters for run, run an application and then import the export file using the Ddms File Explorer tool.

        2. Open the Ddms tool in Eclipse's Windows->open perspective->other ... Open the Ddms tool inside the File Explorer tab of the Ddms tool and select the SDcard directory to import the export file.

    • Use the files in the SD card

      • The installation file browser can view the contents of the SD card:

CMD, go to the Tools directory under the installation path of the Android SDK, run: adb install f:\***.apk

      • Use the scan in Dev tools in the simulator to view the contents of the SD card.

How to create and use an SD card with an Android emulator

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.