ADB的教程

####ADB教程

什么是ADB

adb的全称为Android Debug Bridge,就是起到调试桥的作用。通过adb我们可以在Eclipse中方便通过DDMS来调试Android程序,说白了就是debug工具。adb的工作方式比较特殊,采用监听Socket TCP 5554等端口的方式让IDE和Qemu通讯,默认情况下adb会daemon相关的网络端口,所以当我们运行Android Studio或者Eclipse时adb进程就会自动运行。

#####如何找到ADB
可以在Android SDK 目录下<Android SDK>/platform-tools folders找到adb.exe或者下载ADB Kits
ADB Driver

在windows下调出CMD,WIN + R

1
2
3
cd <adb-path> cd c:\Users\Linda\AppData\Local\Android\sdk\platform-tools\

adb devices

#####ADB的一些基本command
可以在这个网站进行查看
ADB Debugging

1
2
3
4
adb devices
adb forward
adb kill-server

Wireless

1
2
3
adb connect
adb usb

Package Manager

1
2
3
4
5
6
adb install
adb uninstall
adb shell pm list packages
adb shell pm path
adb shell pm clear

File Manager

1
2
3
4
5
6
7
8
9
10
11
adb pull
adb push
adb shell ls
adb shell cd
adb shell rm
adb shell mkdir
adb shell touch
adb shell pwd
adb shell cp
adb shell mv

Network

1
2
3
4
5
adb shell netstat
adb shell ping
adb shell netcfg
adb shell ip

Logcat

1
2
3
4
adb logcat
adb shell dumpsys
adb shell dumpstate

Screenshot

1
2
3
adb shell screencap
adb shell screenrecord [4.4+]

System

1
2
3
4
5
6
7
adb root
adb sideload
adb shell ps
adb shell top
adb shell getprop
adb shell setprop

Comments

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×