分类:
2009-12-08 10:39:49
Android ADB安装:
对于windows xp用户, 需要先安装usb驱动 (1.33 MB)
, 然后如果你只打算使用adb而不想下载整个sdk的话, 可以下载这个单独的adb工具包( (571.56 KB) ). 下载后解压, 把里面 adb.exe 和 AdbWinApi.dll 两个文件放到系统盘的 windows/system32 文件夹里就可以了.
ADB全称Android Debug Bridge, 是android sdk里的一个工具, 用这个工具可以直接操作管理android模拟器或者真实的andriod设备(如G1手机).
它的主要功能有:
1. 运行设备的shell(命令行)
2. 管理模拟器或设备的端口映射
3. 计算机和设备之间上传/下载文件
4. 将本地apk软件安装至模拟器或android设备
ADB是一个 客户端-服务器端 程序, 其中客户端是你用来操作的电脑, 服务器端是android设备.
先说安装方法, 电脑上需要安装客户端. 客户端包含在sdk里. 设备上不需要安装, 只需要在手机上打开选项settings-applications-development-USB debugging.
在DOS下输入以下命令基本可以完成刷机任务,一些常用命令解释如下:
adb devices - 列出连接到电脑的ADB设备(也就是手机),一般显示出手机P/N码.如果没有显示出来则手机与电脑没有连接上.
adb install
adb remount - 重新打开手机写模式(刷机模式).
adb push
adb pull
adb shell
在我们刷recovery时一般按下顺序执行:
adb shell mount -a
adb push recovery-RAv1.0G.img /system/recovery.img
adb push recovery-RAv1.0G.img /sdcard/recovery-RAv1.0G.img
adb shell flash_image recovery /sdcard/recovery-RAv1.0G.img reboot
其它的自己灵活运用了.
ADB命令详解:
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s
ith
the given serial number
-p
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
device commands:
adb push
adb pull
adb sync [
(see 'adb help all')
adb shell - run remote shell interactively
adb shell
adb emu
adb logcat [
adb forward
forward specs are one of:
tcp:
localabstract:
localreserved:
localfilesystem:
dev:
jdwp:
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r]
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
adb uninstall [-k]
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints:
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb root - restarts adb with root permissions
networking:
adb ppp
Note: you should not automatically start a PDP connection.
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [
- If
pdated.
- If it is "system" or "data", only the corresponding partition