Simulate SD card in Android Simulator

Source: Internet
Author: User

I use liunx (UBUNTU) as an example:

1. Create an SD card image file

1) Open the terminal to enter the android SDK directory tools directory (such as my path is/home/XXX/android_install/android-sdk-linux_x86/tools );

2) Run mksdcard creation: root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/tools # mksdcard 256 m sdcard. img

The first parameter is the size of the sdcard to be created (determined by the size), and the second parameter is the name of the sdcard.

2. Import files to sdcard

1) Start the simulator through a terminal

Xxx @ xxx :~ /Android_install/android-sdk-linux_x86/tools $. /emulator-AVD android2.3.3 (here is the name of the AVD you want to start)-sdcard. IMG (this is the SD image file you just created)

2) Open the terminal to go to The toolsplatform-tools directory of the android SDK directory (for example, my path is root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/platform-tools #),

Then execute ADB push 111.mp4/sdcard/. If "667 KB/s (20998944 bytes in 30.716 s)" appears, the copy is completed.

3) after the installation is complete, run the ADB shell command to access the device and view the directory. The directory of the sdcard contains the file pushed in. The terminal is as follows:

Root @ xxx:/home/XXX/android_install/android-sdk-linux_x86/platform-tools # ADB Shell
#
#
# Ls
Acct
Cache
Config
D
Data
Default. Prop
Dev
Etc
Init
Init. Goldfish. RC
Init. RC
MNT
Proc
Root
Sbin
Sdcard
Sys
System
Ueventd. Goldfish. RC
Ueventd. RC
Vendor
# Cd sdcard
# Ls
111.mp4
Android
Dcim
Lost. dir

#

4)my simulator did not find 111.mp4 which I just pushed in to gallery. I restarted the simulator (re-run 1) to find video in Gallery. But I was prompted that the video could not be played.

An error occurred while playing the file.

Summary: in short, the purpose of simulating the SD card is achieved. If you test the push image, you can browse the image normally in the gallery. For video playback, I will try another one.

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.