Create and Use SD card for Android Simulators

Source: Internet
Author: User

1. Create an SD card image file

Open cmd, go to the tools directory under the android SDK installation path, and enter the following command:

Mksdcard 1024 M sdcard. img

This command will generate an sdcard. imgfile in the current directory, which is the SD card image file of the android simulator. 1024m indicates that the SD card has a size of 1024m, that is, 1 GB. Android currently supports 8 m ~ Gb sd card.

2. Run the simulator with an SD card

You have created an SD card image file, but you have created a file that cannot be directly used in the simulator. to load the SD card in the simulator, use the following methods:

(1) Start the simulator with sdcard in cmd

Go to the tools directory under the android SDK installation path and run the following command:

Emulator-AVD name_avd-sdcard. img

Here, name_avd is the name of an existing simulator, and sdcard. IMG is the SD card image file created in step 1.

(2) In eclipse, when creating a simulator, specify the path of the SD card image file and add support options for the SD card.

Open eclipse and go to window> Android SDK and AVD manager. For example:


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

Click new in the hardware column and select SD card surport.

Click Create AVD, OK.

(3) (I have not performed any experiments) in eclipse, enter the startup parameters in the "run-> RUN configurations..." menu, such:

 

 

3. upload files to the SD card

There are also two ways:

(1) In cmd, go to the tools directory under the android SDK installation path and run the following command:

ADB push E: \ test.3gp sdcard/test.3gp

"Read-Only File System" may occur during push. If this problem occurs, perform the following operations:

# Emulator-partition-size 256-AVD file name

# ADB remount

# ADB push *.*/*

E: \ test.3gp is the local file to be uploaded, and sdcard/test.3gp is the path uploaded to the SD card.

Note: ADB push computer path simulator path

"\" Must be used in the computer path, "/" must be used in the simulator path, and the root path of the simulator is

Read.

(2) In the eclipse Environment

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 and open the ddms tool in eclipse Windows> open perspective> other ....

Select the sdcard directory in the file explorer label of the ddms tool to import and export files, for example:

 

4. Use the files in the SD card

(1) The installation file browser can view the content in the SD card:

CMD, go to the tools directory under the installation path of the android SDK, and run: ADB install F: \ ***. APK

(2) Use scan in Dev tools in the simulator to view the content in the SD card.

Another issue is attached:

Failed to push Selection: Read-Only file SYS

This error is always reported when you need to push audio files to sdcard.

 

Solution:

 

Add the file path of the sdcard to Android AVD manager.

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.