Collection of commonly used Android commands (images and texts for beginners)

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:

<Ignore_js_op>

2. android list avds:

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

<Ignore_js_op>

3. android list targets:

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

<Ignore_js_op>

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 ):

<Ignore_js_op>

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.

<Ignore_js_op>

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:

<Ignore_js_op>

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/adb push.

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 + F11Key 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:

<Ignore_js_op> adb (Android Debug Bridge) is a common debugging tool provided by Android. With this tool, we can manage the status of devices or mobile phone simulators.You can also perform the following operations:
1. quickly update the code in a device or mobile phone simulator, such as an application or Android system upgrade;
2. Run shell commands on the device;
3. Manage the ports on the device or mobile phone simulator;
4. Copy or paste files on the device or mobile phone simulator;

The following are some common operations::
1. install the application to the simulator: adb install. Unfortunately, Android does not provide a command to uninstall the application. You can only manually delete the command: adb shell cd/data/app rm app.apk.
2. Enter the shell of the device or simulator: Through the above command, you can enter the shell environment of the device or simulator. In this Linux shell, you can execute various Linux commands. If you only want to execute a shell command, you can use the following method: adb shell [command] such as adb shell dmesg to print the kernel debugging information.
3. Release port: You can set any port number as the request port from the host to the simulator or device. For example, adb forward tcp: 5555 tcp: 8000
4. copy a file: copy a file or directory to a device or from a device to a device or simulator: adb push for example: adb push test.txt/tmp/test.txt copy a file or directory from the device or simulator: adb pull such as adb pull/addroid/lib/libwebcore. so.
5. Search for the simulator/device instance: Obtain the list of instances of the current running simulator/device and the status of each instance: adb devices
6. view the bug report: adb bugreport
7. Record wireless communication logs: Generally, there are many wireless communication logs and there is no need to record them during operation. However, we can still set the record through commands: adb shell logcat-B radio
8. get the device ID and serial number: adb get-product adb get-serialno
9. Access the database SQLite3 adb shell sqlite3
10. The gsm call command can be called like the Android simulator. In addition to calling the Dial button in the DDMS of EclipseADT, the gsm call command can also be called directly through the DDMS shell, we first need to start AndroidEmulator, and then execute telnet localhost 5554 In the cmd environment to dial the Android simulator. The parameter is gsmcall <phoneNum>. For example, call 10086 to gsm call + 10086.

You do not understand the world of the arms, you do not know the life of the arms, and you only know the world of programmers. Programmers, strive for their own wonderful world, and work hard! Come on ......

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.