Android Adb Shell command in detail (with DOS, Linux commands)

Source: Internet
Author: User
Tags clear screen

The ADB shell is often used during the development of Android applications, where a simple summary of the general commands is made.

The content includes DOS, Linux, Shell three blocks (obtained through access to books and web data).

1. First look at commands under Windows DOS

cd--changing the current directory

dir--Displaying folder Contents

md--Creating subdirectories

copy--Copy Files

move--Moving files

del--Deleting files

cls--Clear Screen

attrib--displaying the file's (file) properties

2, next give the Linux under the General Command

cd--changing the current directory

  pwd--View the current directory full path

ls--View the directory or the genus * of the file, list the following files as a directory

mkdir--Building a directory

cp--Copy Files

rm--Deleting files and directories

mv--Remove directory or change file name

chmod/chown--Permissions Modification

clear--Clear Screen

mount--Loading a hardware device

su--switch to another person's identity without exiting the login

grep--text content Search

find--file or directory name and permission belong to the master and other matching search

kill--can kill a process that is in progress or is already in a dest state

df--command to check the disk space consumption of the file system

3. Abd Shell command

3.1 Enter the shell mode of the simulator:
ADB shell

3.2 Install the application:
ADB install-r application. apk
ADB install
ADB install <apk file path >: This command installs the specified APK file on the device
ADB install-r <apk file path >: If the plus-r parameter overwrites the original installed software and preserves the data
Note: APK file name does not use Chinese and does not have a space number

3.3 Unloading APK Package:
ADB shell
CD Data/app
RM APK Package
Exit
The main package name of the ADB uninstall APK package
ADB install-r APK Package

3.4 Get the files in the emulator:
ADB pull <remote> <local>

3.5 Writing files to the simulator:
ADB push <local> <remote>

3.6 Display all Android platforms in the system:
Android list targets

3.7 Display all AVD (simulator) in the system:
Android List AVD

3.8 Displays all the emulators currently running:
ADB devices

3.9 Creating the AVD (emulator):
Android Create AVD--name name--target platform number

3.10 Start the emulator:
EMULATOR-AVD name-sdcard ~/name. IMG (-skin 1280x800)

3.11 Delete AVD (emulator):
Android Delete AVD--name name

3.12 Create SDcard:
Mksdcard 1024M ~/name. img

3.13 AVD (Simulator) Location:
Linux (~/.ANDROID/AVD) Windows (C:\Documents and SETTINGS\ADMINISTRATOR\.ANDROID\AVD)

3.14 Start Ddms:
Ddms

3.15 execute a command on a simulator:
Abd-s Simulator number Command

3.16 Launch SDK, documentation, instance download Manager:
Android

3.17 View the ADB command Help information:
ADB Help

3.18 View the log information on the command line:
ADB logcat-s label Signature

The commands behind the 3.19 adb shell come mainly from:
SOURCE \system\core\toolbox directory and source code \FRAMEWORKS\BASE\CMDS directory.

3.20 Deleting system applications:
ADB remount (re-mount the system partition so that the system partition is re-writable).
ADB shell
CD System/app
RM *.apk

3.21 Get Administrator privileges:
ADB root

3.22 Start activity:
ADB shell am START-N package Name/package name + class name (-N class name,-a action,-d date,-m mime-type,-c category,-e Extended data, etc.).

3.23 Release Port:
You can set any port number as the request port for the host to the emulator or device. Such as:
ADB forward tcp:5555 tcp:8000

3.24 Copying Files:
You can copy files to a device or from a device,
To copy a file or directory to a device or emulator:
ADB push <source> <destination>
such as: adb push test.txt/tmp/test.txt
To copy a file or directory from a device or emulator:
ADB pull <source> <destination>
such as: ADB pull/tmp/test.txt test.txt

3.25 Examples of search simulators/devices:
Gets a list of instances of the currently running emulator/device and the status of each instance:
ADB devices

3.26 Viewing bug reports:
ADB bugreport

3.27 record the wireless communication log:
Generally speaking, the wireless communication log is very many, at run time not necessary to record, but we can still through the command, set the record:
ADB shell
Logcat-b Radio

3.28 get the ID and serial number of the device:
ADB get-product
ADB Get-serialno

3.29 Accessing the database SQLite3
ADB shell
Sqlite3

Android Adb Shell command in detail (with DOS, Linux commands)

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.