Use of the Abd command

Source: Internet
Author: User
Use of the Abd command

To use ADB, you must first configure the path

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:
ADB Shell
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. In addition, if you only want to execute one shell command, you can use the following methods:
ADB shell [command]
For example, ADB shell dmesg prints 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:
You can copy files to a device or from a device,
Copy a file or directory to the device or simulator:
ADB push
Example: ADB push test.txt/tmp/test.txt
Copy a file or directory from a device or simulator:
ADB pull
For example, ADB pull/addroid/lib/libwebcore. So.
5. Search for simulator/device instances:
Obtain the list of running Simulators/devices and the status of each instance:
ADB Devices
6. view the bug report:
ADB bugreport
7. Record wireless communication logs:
In general, there are a lot of wireless communication logs and there is no need to record them during operation, but we can still set the record through the command:
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.
ADB, short for Android debug bridge, is a tool in the android SDK. It can be used to directly manage Android simulators or real Android devices (such as G1 mobile phones ).

Its main functions include:

 

Run the shell of the device (command line)
Manage port ing between simulators and devices
Upload/download files between computers and devices
Install the local APK software on a simulator or Android device


ADB is a client-server program, where the client is the computer you use to operate and the server is an Android device.

First, let's talk about the installation method. You need to install the client on your computer. The client is included in the SDK. You do not need to install it on the device. You just need to open the option settings-applications-Development-USB debugging on your mobile phone.

For Mac and Linux users, after the downloaded SDK is decompressed, you can ~ Or any directory. Then modify ~ /. Bash_profile file, set the runtime environment to point to the SDK's tools directory.
Open ~ /. Bash_profile file (if this file is not available, you can add it yourself), add a line in it:

Export path =$ {path }:< your SDK directory>/tools

For example:

 

Then you can use the ADB command.

You can skip the installation steps and directly enter the full path to use the command, for example:

 

For Windows XP users, you need to install the USB driver first. If you only want to use ADB and do not want to download the entire SDK, you can download this independent ADB toolkit and decompress it, put adb.exe and adbwinapi in it. DLL files can be stored in the Windows/system32 folder on the system disk.

Now let's talk about several commands commonly used by ADB.
1. View Devices

ADB Devices
This command is used to view the currently connected devices. The Android devices or simulators connected to the computer are listed and displayed.

2. Install software

ADB install <APK file path>
This command installs the specified APK file on the device.

3. uninstall software

ADB uninstall <software Name>
ADB uninstall-k <software Name>
If the-k parameter is added, the software is uninstalled but the configuration and cache files are retained.

4. log on to the device Shell

ADB Shell
ADB shell <command>
This command will log on to the shell of the device.
The <command> command is used to directly run the device command, which is equivalent to executing the remote command.

5. Send files to the device from the computer

ADB push <local path> <remote path>
Use the push command to copy files or folders on the local computer to the device (mobile phone)

6. download files from your device to your computer

ADB pull <remote path> <local path>
Run the pull command to copy files or folders on the device (mobile phone) to the local computer.

7. display help information

ADB help
This command displays help information
ADB is a client-server program, where the client is the computer you use to operate and the server is an Android device.

First, let's talk about the installation method. You need to install the client on your computer. The client is included in the SDK. You do not need to install it on the device. You just need to open the option settings-applications-Development-usbdebugging on your mobile phone.

For Mac and Linux users, after the downloaded SDK is decompressed, you can ~ Or any directory. Then modify ~ /. Bash_profile file, set the runtime environment to point to the SDK's tools directory.
Open ~ /. Bash_profile file (if this file is not available, you can add it yourself), add a line in it:

Export path =$ {path }:< your SDK directory>/tools

Then you can use the ADB command.

If installation is troublesome, you can skip the above installation steps and directly enter the complete path to use the command.
For Windows XP users, install the USB driver android_usb_windows.zip (1.33 MB) first. If you only want to use ADB and do not want to download the entire SDK, you can download the ADB toolkit adb_win.zip (571.56 KB) and decompress the package. DLL files can be stored in the Windows/system32 folder on the system disk.

 

Several commands commonly used by ADB
1. View Devices

1. ADB Devices
This command is used to view the currently connected devices. The Android devices or simulators connected to the computer are listed and displayed.

2. Install software

1. ADB install <APK file path>
This command installs the specified APK file on the device.

 

3. uninstall software

1. ADB uninstall <software Name>
2. ADB uninstall-k <software Name>
If the-k parameter is added, the software is uninstalled but the configuration and cache files are retained.

4. log on to the device Shell

1. ADB Shell
2. ADB shell <command>
This command will log on to the shell of the device.
The <command> command is used to directly run the device command, which is equivalent to executing the remote command.

5. Send files to the device from the computer

1. ADB push <local path> <remote path>
Use the push command to copy files or folders on the local computer to the device (mobile phone)

6. download files from your device to your computer

1. ADB pull <remote path> <local path>
Run the pull command to copy files or folders on the device (mobile phone) to the local computer.

7. display help information

1. ADB help
This command displays help information

 


Delete the built-in Android Rom Software

 

The Android system does not have the function to uninstall the built-in software of Rom. Some users may want to delete YouTube, Which is useless and wants to delete Twitter on the other side of the wall.

In addition, the android shortcut cannot be modified, and the sorting cannot be performed on its own.

Too many programs will find it difficult to find what you want.

To sum up, I think it is necessary to tell cainiao personnel how to delete their own programs.

1. confirm that the mobile phone is root. You have obtained the root permission to delete the system file.

2.download android_db.rar and decompress it to % WINDIR/% system32.

3. Connect the data cable to your mobile phone, open cmd on your computer, and enter the command

 

ADB remount

ADB Shell

Su

After the execution is complete, you will see:

* Daemon not running. Starting it now *

* Daemon started successfully *

4. in Linux Command Line Mode, enter

 

CD system/APP

You will find that there is no change, and then enter ls to press Enter.

At this time, the list shows all the files in the system/APP, that is, some rom integrated software.

5.open or delete the file youtube.odexand youtube.apk.

To delete these two files, run the following command:

 

Rm YouTube .*

After restarting, YouTube has been deleted. Please do not delete anything you don't know.
Android debug bridage

 

ADB is one of the important Android tools to provide powerful features, such as copying files to devices or copying files from devices. You can use shell command line parameters to connect to the mobile phone itself and send basic shell commands.

 

Go to the command line and use

Java code
ADB Shell

ADB Shell

Enter the shell mode in andvoid. Note that the simulator or mobile phone must be enabled and properly connected at this time.

 

In this shell environment, you can:

The network configuration is displayed. The network configuration displays multiple network connections. Note the following Network Connections:
Lo is a local or loopback connection.
Tiwlan0 is a Wi-Fi connection provided by the local DHCP server.
Displays the content of the PATH environment variable.
Run the su command to become a Super User.
Change the directory to/data/APP, where the user application is stored.
Lists the directories that contain an application. Android Application Files are actually archive files, which can be viewed through software such as WinZip. The extension is APK.
Run the ping command to check whether Google.com is available.
In the same command prompt environment, you can also interact with the SQLite database, start programs, and execute many other system-level tasks. Imagine that you are connecting to the phone, so this is a great feature.

 

I. ADB command

Java code
ADB get-product // get the device ID
ADB get-serialno // gets the serial number of the device.
ADB devices // obtain the list of instances of the current running simulator/device and the status of each instance
ADB bugreport // view the bug report

ADB get-product // get the device ID
ADB get-serialno // gets the serial number of the device.
ADB devices // obtain the list of instances of the current running simulator/device and the status of each instance
ADB bugreport // view the bug report

Ii. shell commands

 

Run the ADB shell command to enter the shell and then run the following command.

 

1. Access the database:

Java code
Sqlite3

Sqlite3 2. Record wireless communication logs:

In general, there are a lot of wireless communication logs and there is no need to record them during operation, but we can still set the record through the command:

Java code
Logcat-B radio

Logcat-B Radio 3. delete an application:

Android does not provide a command to uninstall an application. You need to manually delete it:

Java code
CD/data/APP
Rm appname.apk

CD/data/APP
Rm appname.apk Note: [appname] indicates the name of the application;

 

3. Some Linux commands that can be used in Android Shell

Command:

Java code
Ls // view the Directory
Date // print or set the current system time
CAT/proc/meminfo // view memory information
CAT/proc/cpuinfo // view CPU Information

Ls // view the Directory
Date // print or set the current system time
CAT/proc/meminfo // view memory information
CAT/proc/cpuinfo // view CPU Information

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.