Zhao Yazhi _android using adb command to explain the drawings

Source: Internet
Author: User

ADB is a client - server program in which the client is the computer you are using to operate the server , which is the android device

We can also operate with the cmd command line In addition to working in a visual window .


Enter cmd in the search bar of the Start menu to Open the command line

Locate the adb.exe Path (1.1) locally, drag the adb.exe to the cmd command line and hit Enter to display all the actionable help examples (1.2).

Figure 1.1 adb.exe Path

Figure 1.2 adb Command Example

If you do not enter the correct path for adb to display normally,1.3:

Figure 1.3adb failed to open correctly

To ensureadbcan be used under any path, we willadbpath is configured toPathPath, set pathThe Path method is:Computer-Properties-Advanced-Environment Variables-System Variables-path. 1.4. InPath, putadbpath is added to thePathpath (plus semicolon), restartcmdcommand Line。 At this point, regardless of the path, enter the ADBcan be manipulated,1.5.

Figure 1.4 Setting the path path

Figure 1.5 The adb case display after setting the path path

The above for its related command instructions , of course, if your English is good enough , In fact, these are very simple , of course , If you're not used to reading these English descriptions, , Then let me help you with the problem . There are several key commands that need to be understood:

First, ADB devices

List all the devices , 2.1.1

Figure 2.1.1 ADB devices List of all devices

The corresponding visual window 2.1.2

Figure 2.1.2 Visualization window List of all devices

Second, the ADB shell

Mount to Linux Space (you can only hang into Linux space when you have an emulator). 2.2.1

Figure 2.2.1 the adb shell to mount linux space

The Linux command,ls for viewing the files in the directory, cd/home into the "/home" directory, ctrl C exit, according to the operation of the Linux command 2.2.2

Figure 2.2.2 Enter the acct of the phone directory and view the catalog file

Corresponding Visualization window 2.2.3:

Figure 2.2.3 Enter the acct of the phone directory and view a visual view of the catalog file

Third, adb install xxx.apk

Indicates that the APK to be packaged is installed on the device, and if there are multiple devices, we can specify the device adb –s emulator-5554 install d:/xxx.apk.

2.3.1 has an apk file that is installed on the device through the cmd command line,2.3.2. Next we will see the mobile device more lession01_sms Such a program,2.3.3.

Figure 2.3.1 local apk file

Figure 2.3.2 Installing the APK file to your phone with the cmd command Line

Figure 2.3.3 Simulator installation Successful interface

If you turn on multiple devices at the same time, the cmd command line input adb install xxx.apk will be error (2.3.4), so we need to specify the simulator to install.

Figure 2.3.4 two devices simultaneously open will error

At this point we need to develop the device name, command line input adb–s device name install apk file (2.3.5)

Figure 2.3.5 multiple device development apk installation Device

At this time looking at the Android device,lession01_phone on the installation succeeded,2.3.6.

Figure 2.3.6 lession01_phone installation succeeded

Iv. EMULATOR–AVD Advname

Launch Simulator Select the virtual device in the Visualization window, click Start in the right toolbar to launch the corresponding simulator (2.4.2)

Figure 2.4.2 A visual window to start a virtual appliance

V. Mksdcard [-L label] <size> [k| M] <file>

CreateSDcard。 [-L label]definitionSDthe volume label name of the memory card's disk area. <size>That is used to specify the createdSDthe size of the memory card can be how many thousand (K)byteor how many million (M), such as1024M,512K. <file>is the createdSDthe file path of the memory card, as shown in the following example.
Example: creatingSDMemory Card

C:\android-sdk-windows\tools>mksdcard 512M Mycard

C:\ANDROID-SDK-WINDOWS\TOOLS>EMULATOR-AVD Avd-api7-sdcard Mycard

Sd card image file for Figure 2.5.1 with lock file will automatically appear when the simulator starts, the emulator off automatically disappears.

Figure 2.5.1sdcard image File

Vi. adb push <local> <remote>

Import the file into the SD card. Local is the file that will be imported, andremote represents the SD card directory. as shown in 2.6.1

Figure 2.6.1 the 1.gif of the D Drive into the sdcard under mnt

The import file is in the visual string.

Vii. adb pull <remote> <local>

Export the files from the SD card. remote represents the directory in the SD card, Local is the native path you need to import. import 1.gif into the d - disk gif folder (2.7.1 ) To view the export file 2.7.2locally.

Figure 2.7.1 Importing 1.gif to the D - disk gif folder

2.7.2 Viewing an export file under a local folder

The export file is in the Visual window.

Eight Android Create Avd–name Android4.2.2–target 17

Create simulator

In the visual window for 2.8.1

Figure 2.8.1 Creating a new simulator

Nine, Android list Avds

List all virtual devices that are created

Becauseandroid commands can only be opened in tools because of 4.0 and above, we need to assign paths to tools Path in order to use the path beginningwith android ,2.9.1.

Figure 2.9.1 shows all the avd devices created

In the We see a total of 3 virtual devices created, corresponding to 2.9.2 in the visual window


Figure 2.9.2 Viewing all the AVD devices created in the visualization window

TenAndroid

Show SDK and AVD manager 2.10.1, showing results 2.10.2

Figure 2.10.1 display SDK and AVD manager

Figure 2.10.2 SDK and AVD manager display results

Xi. Android list targets

List the versions of the SDK we can use (2.11.1)

Figure 2.11.1 The version of the SDK we can use with the command line

2.11.2 in the visualization window

Figure 2.11.2 A visual window that lists the versions of the SDK we can use

12, CTRL + F11

Toggle 2.12.1 and 2.12.2 on the screen

Figure 2.12.1 before switching

Figure 2.12.2 after switching


Reprint Please specify source: http://blog.csdn.net/zhaoyazhi2129/article/details/26468089

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.