C language basics Lesson 3 Use of ADB (Android Debug Bridge), adbandroid

Source: Internet
Author: User

C language basics Lesson 3 Use of ADB (Android Debug Bridge), adbandroid

C language basics Lesson 3 Use of ADB (Android Debug Bridge)

 

 

Since I have published a Linux blog before, I will not post a blog on Linux basic commands separately. In this tutorial, I will use adb to connect to a mobile phone to review basic Linux commands. You are also familiar with the underlying operations of mobile phones. you can install software, uninstall software, and transmit data from PCs without interface operations.

 

 

 

 


Contents

1Connect android devices to PC. 3 through USB

2View the current device... 3

3Go to device shell. 4

4Execute the shell command... 4

5Introduction to the andriod command... 4

6Copy device files to PC. 4

7Copy the PC file to the device... 5


1. Connect the android device to the PC through USB

Enable the "Settings" function of the Android device;

Open "Developer options ";

Select USB debugging,

 

2. view the current device

Adbdevices

 

 

Install adb to drive C

Set the path environment variable so that it can find the adb executable program

 

 

3. Enter the device shell

Adbshell

 

4. execute shell commands

Adbshell command

Enter an ls command

5. About andriod commands

Cat

Pwd

Date

Df

Kill

Ln

Mkdir

Rmdir

Rm

Mv

Ps

Top

You can see the detailed information in the directory.

6. Copy the device file to the PC

Adb pull device file path PC file path

For example:

Adb pull/system/app/SecPhone.apk d: \ SecPhone.apk

Disk D.

7 copy PC files to devices

Adb pushPC file path: Device File Path

This step will be handed over to you for practice.


Android Debug Bridge cannot be found for half a day. Download the ADB. Download the mobile phone. Unlock the mobile phone. Then root, but cannot find the adb software.

Pai.andorid.com
Download Android SDK
Yes.

[Android] How to Use ADB for debugging

It is a general debugging tool used to manage simulators and real machines. It is powerful. You can directly open cmd to use the adb command. adb is called Android Debug Bridge, and serves as the debugging Bridge, through adb, We can debug the Android program through DDMS in Eclipse. To put it bluntly, it is the debug tool. adb works in a special way, the ** Socket TCP 5554 and other ports are used to allow the IDE to communicate with Qemu. By default, adb will use the network ports related to daemon. Therefore, when we run Eclipse, the adb process will automatically run, with the adb tool, we can manage the status of devices or mobile phone simulators, and perform many mobile phone operations, such as installing software, upgrading the system, and running shell commands. In short, adb is a bridge between Android phones and PCs, allowing users to perform comprehensive operations on their phones on their computers.
1: view the status of the current simulator or Android device instance
The adb devices command is usually used to view the status of the simulator before use. The ADB response information is obtained through this command, and the ADB response information is displayed.
1.1: emulator-5554 is the Instance name
1.2: device indicates the instance connection status. device indicates that the instance is connected to adb. offline indicates that the instance is not connected to adb or cannot respond.
2. Install and uninstall the APK Application
You can copy an APK application from your computer to a simulator or Android device, install the software using adb install <path_to_apk, and uninstall the software using adb uninstall <packageName. If you do not know the package name, in AndroidManifest. you can find package = "" in xml.
2.1: first copy the apk file to the tools in the sdk directory
2.2: switch to the tools directory under the SDK installation path under dos
2.3: run the installation command
Adb install <path_to_apk
The error occurred because I connected to the real machine and turned on the simulator, so adb gave me a Response Message "more than one driver and Simulator ", when I close the simulator and run the installation command, the system prompts that the installation is successful.
Uninstall APK
3: Copy files from the local machine to the simulator or Android device
Adb push <local path <remote path <local path refers to the target file on your machine or simulator, and <remote path refers to the target file on the remote device instance.
4: Copy files from the simulator to the simulator or Android device
Adb pull <remote path <local path, <local path refers to the target file on your machine or simulator, <remote path refers to the target file on the remote device instance
Enter the adb shell to enter the shell command line. You can use some common shell commands, such as the ls command to list the files.

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.