ADB command Details (i)--Simulator related command set

Source: Internet
Author: User

For Android developers, it is not enough to have an android real machine if you want to test the effects of a program you have developed on all Android versions, although you will be brushing your machine, it will only waste your precious time, and this time using the ADB tool will be different. You can test your app to the desired effect on all versions of the Android emulator.


Another case is the latest development tools Android Studio to download HAXM when launching the simulator, even cumbersome configuration, if this time do not want to be so troublesome, then the ADB command to start the simulator will be your good choice. Here we describe all the commands associated with the simulator.


1. Get the system image of the emulator


You can use this command to get a list of system images that you can use in your system:


"Path-to-sdk-install"/tools/android list targets


Alternatively, you can use the following command on the Windows terminal:


C:\[path-to-sdk-install]\tools\android list targets


For example, you can enter the following command at the command prompt:


C:\users\liyuanjing>android list targets


The effect is as follows:




The reason why I did not enter the installation SDK directory is because I configure the installation path with this environment variable to go, this can save time, if you do not configure please refer to http://jingyan.baidu.com/article/ 17bd8e52f514d985ab2bb800.html the URL.


This command will list all the available system images in your system. If you still want more system images, you can install them through the SDK manager. In this list you want to write down the ID of the mirror, because in the following steps you need to use them to identify the system image.


2. Create an AVD


Use the following command to create an AVD


"Path-to-sdk-install"/tools/android create Avd-n [name of your new AVD]-T [System image Target ID]


You must give a name to the AVD you created, which can be specified by the-n parameter, and the system image ID you selected in the previous step must also be specified by the-t parameter. If everything is OK, you should have created a new virtual device with your own name.


For example, you can enter the following command at the command prompt:


C:\users\liyuanjing>android Create Avd-n liyuanjinglyj-t 14


The effect is as follows:




3. Start the AVD


You can use the following command to run the new AVD that you have given it a name:


"Path-to-sdk-install"/tools/emulator-avd [the name of the AVD]


Where [the name of the AVD] is the name you gave the AVD in the previous step. If everything works, your new AVD will start up.


For example, you can enter the following command at the command prompt:


C:\USERS\LIYUANJING>EMULATOR-AVD Liyuanjinglyj


The effect is as follows:




4. Extended Simulator function


Virtual one memory card or one extended storage device


When creating a virtual device, you can use the-c parameter to have the newly created device also have some extended memory, the format of the command is as follows:


Android Craete-avd-n [AVD device name]-T [image ID]-C [Size][k| M


For example, the following command:


Android Create-avd-n virtdroid-t 1-c 128


You should obviously enter the size of the new virtual memory card, and you also need to specify whether the unit is K (Kbytes) or M (MBytes).


Sets the internal storage size.


Another useful thing you might want to do is to specify the size of the internal storage for the virtual Android device. When using the emulator command, you can use the-partition-size parameter to set it. The format of the command is as follows:


EMULATOR-AVD [name]-partition-size [size in MBs]


You need to enter the size of the system partition. By default, the unit is megabytes (MB)



5. Display the currently running emulator


The command is as follows:


ADB devices


The effect is as follows:




6. Display all AVD and details of the system


The command is as follows:


Android List AVD


The effect is as follows:




7. Delete the AVD


The command is as follows:


Android Delete avd-n [simulator name]


For example, you can enter the following command at the command prompt:


C:\users\liyuanjing>android Delete Avd-n Liyuanjinglyj


The effect is as follows:



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

ADB command Details (i)--Simulator related command set

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.