Android debugging ADB

Source: Internet
Author: User
Tags linux shell commands

In fact, most of the PC development machine and Android devices are done through the ADB (Android Debug Bridge) technology, which is a C/s Architecture command-line tool, mainly composed of three parts

A command-line client running on a PC development machine: It can install, uninstall, and debug an application running on a PC development server: It manages the client-side link to the ADB background process on Android devices running on Android devices in the background of ADB Background Process 1.adb Command Reference Sub-commandDescriptionDevicesList all running Android devicesLogcatThe logs that promise the Android systemBugreportprint output of Dumpsys, Dumpstate, and Logcat, and use it as an accessory to assist developers in the aftermath of error reportingInstallinstall an. apk file to the specified deviceUninstalluninstall an app from the specified devicePullcopy files on your Android device to your local development machinePushCopy the files on your local development machine to your Android deviceForwardforwards the local socket connection to the port of the specified device, either a socket port or a different portPppPPP execution via USBGet-serialnoserial number of the printing deviceGet-stateStatus of the printing deviceWait-for-deviceexecute the command after the device is availableStart-serverstart the ADB server processKill-serverend ADB Server processShellOpen the shell of the specified Android device to execute the shell command2.ADB common commands 1. List all devices connected to the development machine ADB devices List of devices attached7f324a28DeviceWhere 7f324a28 is the serial number, the ADB-generated string that uniquely identifies an emulator instance or Android device  device is a state that indicates that the device has been linked to the ADB server. There are other states, such as offline, that indicate that the device is not linked to the ADB server, or that there is no response for any reason; no device, which indicates that no devices are currently connected to  2. Install and uninstall apps using ADB installation and application  adb test.apk  Uninstall Application  adb Uninstall com.test  installation parameters are the absolute path of the. apk file that needs to be installed, and when unloaded, the parameter is the package name of the app  3. Use ADB to transfer files between devices and PCs upload files from pc to android adb push ~/dumpstate.txt/sdcard/  Above means uploading PC Dumpstate.txt to android sdcard directory   download from Android to pc adb Pull/sdcard/dumpstate.txt ~/desktop/  Download the SDcard dumpstate.txt from Android to your PC's desktop  4. Android Shell command is based on Linux system development, It also provides a linuxshell for programmers to run common Linux commands, which are stored in the "/system/bin" folder on the Android system, which enables the shell of the remote Android system to be launched via ADB. or execute a shell command directly.  android shell commands include many common Linux shell commands (such as Ls,cat,ps,kill), and several important commands included with Android are described below   DFADB Shell df  shows the space of each partition in the Android system  filesystem               Size   &NBSP ; Used     free   Blksize/dev                  1011.4m   164.0K  1011.2m   4096/mnt/secure           1011.4M     0.0K  1011.4m   4096/mnt/asec             1011.4M     0.0K  1011.4m &NB Sp 4096/mnt/obb              1011.4m     0.0K  1011.4m   4096/system & nbsp             1009.3M   413.5M   595.8M   4096/cache       &NBSP ;         252.1M     4.3M   247.8M   4096/data           &N Bsp        4.9g   186.4M     4.7G   4096/mnt/shell/emulated     16.0G    29.2m    16.0g   32768dumpstate outputs the current state of the Android system, and prints the output to the screen if no parameters are included. Because the output is very much, in general, it is output to an Android device using its "-o" option, and sometimes to save space, you can also use the "-z" option to tell Dumpstate that the content is compressed into the output file in gzip format.  ADB Shell Dumpstate-o/sdcard/dumpstate-zadb PULL/SDCThe ard/dumpstate.txt.gz ~/desktopgunzip ~/desktop/dumpstate.txt.gzdumpsysandroid system runs a number of system services by default, such as the battery service for monitoring battery information.  dumpsys meminfo, Print memory usage dumpsys activity, print all activity information Dumpsys WiFi, print wireless network connection Information Dumpsys window, print about keyboard, Information about the stacking order of the z-axis between all windows and Windows can be done by a little trick to list all Dumpsys subcommands  adb Shell Dumpsys | grep dump 

A companion tour, a free dating site: www.jieberu.com

Push family, free tickets, scenic spots: www.tuituizu.com

Android debugging ADB

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.