Android advanced tutorial (I) ------- collection of frequently-used names and commands for Android (illustrated)

Source: Internet
Author: User

Hello everyone, today we are going to talk about the collection of commonly used naming commands in android development. Android commands will inevitably be used in our development. Some commands are indeed very useful.

This is especially true for some beginners. For example, if they want to install a .apk file on the simulator, they will not start the simulator. They will only start Eclipse and then start the simulator, which will not only waste time, but also occupy your memory. This is why I have summarized this article and I hope it will help you.

If you want the system to know the commands you enter (for example, enter the android command), you can use either of the following methods: 1. set environment variables. (similar to setting the java path, check it online !); 2. directly go to the tools directory (cd: sdkpath/tools) in your SDK, Which is OK. However, we recommend that you use the first one here! Below is my summary:

1.Android:

If you enter android, the SDK and AVD manager will be displayed. we can update the SDK and add, delete, and modify AVD. The effect is as follows:

 

2. android list avds:

This command will list all the android simulators we have created. The effects are as follows:

 

3. android list targets:

This command lists all available SDK versions. The effect is as follows:

 

4. adb devices:

This command is used to list all the loaded settings. The result is as follows (one is a simulator and the other is a real machine ):

 

5. adb shell:

This command is to enter the root directory/of the device to gain control of the device, such as entering the ls command.

 

6. adb install XXX.apk.

This command is used to install the apk file. If you have multiple devices (and want to install the apk on the emulator-5554 simulator), enter: adb install-s emulator-5554 D:/XXX.apk.

7. emulator-avd avdname

This command will start a simulator. If beginners learn this, they don't need to start Eclipse the next time they start the simulator. The usage is as follows:

 

8. mksdcard 256 M d: sdcard. img

Of course, the simulator needs to create an sdcard. This command will generate a m sdcard under drive D.

9. adb pull <remote> <local>/adb push <local> <remote>.

After creating the sdcard, we need to put something in it, or get the stuff out of it, we will use the above command. Take adb push (store things outside sdcard.) as an example. The usage is as follows:Adb push foo.txt/sdcard/foo.txt

10. android create avd -- name Android2.0 -- target 5

This is the command for creating avd. -- Name is followed by the avd name, and target is the SDK version. This statement is used to create avd named Android2.0 and version 5.

Android list avds can be used after creation. Check whether the creation is successful.

11.Ctrl + F11 Key Usage

When we start the simulator, it is usually port mode. If we want to see the effect in land, this combination button will be used. Let's take a look:

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.