Some common command prompt (cmd) directives for Android

Source: Internet
Author: User

I've described how to configure environment variables for the Android SDK in the Android Foundation Eclipse build Android development environment and create your first Android project. We can use these Android commands directly in the Windows command Prompt (CMD) window to assist us in the development.

1. In the command line Management simulator device (AVD)

    • List: Lists all installed Android versions and AVD devices on the machine
    • List AVD: Lists all the AVD devices that have been installed on the machine;
    • List target: Lists all installed Android versions on the machine
    • Create AVD: Creating an AVD Device
    • Delete AVD: Delete an AVD device
    • Update AVD: Upgrade an AVD device to conform to the new SDK environment
    • Create project: Creating a new Android project
    • Update Project: Updating an existing Android project
    • Create Test-project: Creating a new Android test project
    • Update Test-project: Updating an existing Android test project

Example 1: To view all the installed AVD devices on the current system, you can enter: Android list AVD, such as:

Example 2: Create a completely new AVD device that can perform the following commands:

Android Create avd-n <AVD name >-T <SDK version number >-S <AVD skin >-P <avd save path >

Example: Android Create Avd-n 1.5-t 3-s HVGA

2. Start the simulator with the emulator command

There are two ways to start the emulator using the Emulator.exe:

    • EMULATOR-AVD <AVD name >
    • Emulator-data < image file name >

For example, the following command:

EMULATOR-AVD 2.2//Here is an AVD device with a running name of 2.2

Emulator-data Userdata-qemu//Here to run the AVD device as a userdata-qemu image file, which is located in the AvD folder directory where the AVD device is saved, such as:

3. Commonly used ADB commands

ADB is a very powerful tool that is located in the Platform-tools subdirectory of the SDK installation directory, which can either replicate the emulator files with the computer files, install the APK app, or even switch directly to the Android system to execute the Linux command.

    • Adb-devices: View the currently running emulator
    • ADB push c:/123.doc/sdcard/: Copying computer files to the emulator
    • ADB push/sdcard/abc.txt c:/: Copying emulator files to your computer
    • ADB shell: Launches the emulator's shell window, where you can execute Linux commands directly in the shell window of the emulator
    • ADB install [-r] [-s] < file >: Install the apk file, where-R means reload the apk,-s to install the APK onto the SD card, which is installed on the internal storage by default
    • ADB uninstall [Packge] [-K]: Uninstalls a package from the system,-K means that only the application is deleted, but all data and cache directories for that application are preserved

If any of the above is inappropriate, welcome to shoot Bricks!

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.