Android Common Command Collection (illustrated for Beginners) _android

Source: Internet
Author: User

Hello everyone, today we are going to talk about the Android development, the more commonly used name collection, in our development will inevitably use the Android command, some of the actual command is really useful.

Especially for some beginners, commands don't even want to use them, like they want to install a. apk file onto the emulator, but they don't start the simulator, they just start eclipse and then start the simulator, which is not only a waste of time, but Eclipse is also consuming your memory. This is why I sum up the reason for this article, I hope to help you.

If you want the system to recognize the commands you enter (e.g., enter the android command) there are two ways: 1. Set the environment variable. (and set Java path, specific online check Oh!); 2. Direct access to the tools directory in your SDK (Cd:sdkpath/tools) This is OK, but here's the first one! Here's a little summary of yourself:

1.android:

All you have to do is enter Android and you'll get out, SDK and AVD Manager we can update the SDK and modify the AVD. The effect is as follows:

<ignore_js_op>

2.android List Avds:

This command will list all the Android emulators we created. The effect is as follows:

<ignore_js_op>

3.android list targets:

This command lists all of our SDK available versions, and the effect is as follows:

<ignore_js_op>

4.ADB Devices:

This command lists the settings for all mounts, and the effect is as follows (one is an emulator, the other is a real machine):

<ignore_js_op>

5.ADB Shell:

This command is to enter the device root directory/To obtain control over the device, such as the input LS command.

<ignore_js_op>

6.ADB install xxx.apk.

This command is to install the APK file, if you have multiple devices (and you want to install APK to the EMULATOR-5554 emulator), enter: adb install-s emulator-5554 d:/xxx.apk.

7.EMULATOR-AVD Avdname

This command will start an emulator, which beginners learn to do without having to turn on eclipse the next time the simulator is started. Usage is as follows:

<ignore_js_op>

8.mksdcard 256M d:sdcard.img

For the simulator of course to create sdcard, this command will be under D disk to generate 256M sdcard.

9.ADB pull/adb push.

After we create the sdcard, we have to put something in it, or we can get the contents out of it, we use the above command. With the ADB push (put something out of the sdcard.) For example, use the following:adb push foo.txt/sdcard/foo.txt

10.android Create AVD--name Android2.0--target 5

This is the command to create the AVD. The--name is followed by the name of the AVD, and target is the version of the SDK. This statement is to create a AVD with a name of Android2.0 and a version of 5.

You can use the Android list AVDS after you create it. See if success has been created.

Use ofCTRL + F11 keys

When we start the simulator, it's usually port mode, and if we want to see the effect under Land, the combo button will work. Look at the effect chart:

<ignore_js_op> adb is a common debugging tool provided by Android, which enables us to manage the status of devices or phone simulators.You can also perform the following actions
1, fast update equipment or mobile phone simulator code, such as applications or Android system upgrades;
2, on the device to run the shell command;
3, management equipment or mobile phone simulator on the reservation port;
4, in the equipment or mobile phone simulator copy or paste files;

The following are some common operations
1, installation application to the simulator: adb install Unfortunately, Android does not provide a command to uninstall applications, only manually delete: adb shell Cd/data/app RM app.apk
2, enter the device or simulator of the SHELL:ADB shell through the above command, you can access the device or simulator shell environment, in this Linux shell, you can execute a variety of Linux commands, and if you want to execute only a shell command, You can do the following: ADB shell [command] such as: adb shell DMESG will print out the kernel debugging information.
3, publishing port: You can set any port number, as the host to the simulator or device request port. such as: adb forward tcp:5555 tcp:8000
4. Copy files: can copy files to a device or from a device, copy a file or directory to a device or simulator: adb push test.txt/tmp/test.txt Copy a file or directory from a device or emulator: ADB pull such as: ad b pull/addroid/lib/libwebcore.so.
5. Search Simulator/Device instance: Get the list of instances of the currently running emulator/device and the status of each instance: ADB devices
6. View bug report: ADB bugreport
7, record wireless communication log: In general, the wireless communication log is very much, in the runtime does not need to record, but we can still pass the command, set records: ADB shell Logcat-b Radio
8, get the ID and serial number of the device: adb get-product adb Get-serialno
9, access to the database SQLite3 adb shell sqlite3
10, through the GSM call command can be like the Android simulator phone, in addition to the Eclipseadt in the DDMS through the button dial, but also through the DDMS Shell calls GSM call command direct call, we need to start first androidemulator , and then execute telnet localhost 5554 under the CMD Environment to dial the Android simulator, Gsmcall < phonenum>, for example, call 10086 for GSM +10086

You do not understand the world of God, the life of the worm you do not, only the process of the world of apes people know. Program apes, for their own wonderful World struggle bar, efforts! 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.