集安教育信息网,盛易充值中心,苏州26路公交车路线
adb的全称为android debug bridge.是android司机经常用到的工具
.
adb -s serialnumber shell
adb version
adb logcat
adb devices
adb get-state
adb start-server
adb kill-server
adb push local remote
adb pull remote local
注:am和pm命令必须先切换到adb shell模式下才能使用
am全称activity manager,你能使用am去模拟各种系统的行为,例如去启动一个activity,强制停止进程,发送广播进程,修改设备屏幕属性等等。当你在adb shell命令下执行am命令:
am <command>
am start -n {packagename}/.{activityname}
am kill <packagename>
am force-stop <packagename>
am startservice
am stopservice
am start -a android.intent.action.view -d http://www.jianshu.com/
am start -a android.intent.action.call -d tel:10086
pm全称package manager,你能使用pm命令去模拟行为或者查询设备上的应用等,当你在adb shell命令下执行pm命令:
pm <command>
pm list packages
pm install/uninstall
adb shell input text <string>
手机端输出demo字符串,相应指令:adb shell input "demo".
input keyevent <keycode>,其中keycode见本文结尾的附表
点击返回键,相应指令: input keyevent 4.
input tap <x> <y>
点击坐标(500,500),相应指令: input tap 500 500.
input swipe <x1> <y1> <x2> <y2> <time>
从坐标(300,500)滑动到(100,500),相应指令: input swipe 300 500 100 500.
200ms时间从坐标(300,500)滑动到(100,500),相应指令: input swipe 300 500 100 500 200.
logcat \| grep <str>
logcat \| grep -i <str>
logcat -d
logcat -c
logcat -t <count>
logcat -v <format>
brief — 显示优先级/标记和原始进程的pid (默认格式)
process — 仅显示进程pid
tag — 仅显示优先级/标记
thread — 仅显示进程:线程和优先级/标记
raw — 显示原始的日志信息,没有其他的元数据字段
time — 显示日期,调用时间,优先级/标记,pid
long —显示所有的元数据字段并且用空行分隔消息内容
查看节点值,例如:cat /sys/class/leds/lcd-backlight/brightness
修改节点值,例如:echo 128 > sys/class/leds/lcd-backlight/brightness
echo n > /sys/modue/lpm_levels/parameters/sleep_disabled
/sys/class/leds/lcd-backlight/brightness
/sys/devices/system/cpu/cpu0/cpufreq
/sys/class/ kgsl/kgsl-3d0/gpuclk
cat /data/pmlist.config
cat /sys/class/power_supply/battery/current_now
dumpsys power
data/misc/wifi/wpa_supplicant.conf
echo a> sys/power/wake_lock
echo a> sys/power/wake_unlock
cat sys/kernel/debug/wakeup_sources
mv /data/misc/display/calib.cfg /data/misc/display/calib.cfg.bak 重启
echo 0 > /sys/device/virtual/graphics/fb0/cabc_onoff
echo 3 > /sys/device/virtual/graphics/fb0/cabc_onoff
sdk/tools/monitor
echo /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1497600
adb shell mount -o rw,remount /
adb reboot edl
sys/class/private/tlmm 或者 sys/private/tlmm
sys/kernle/debug/gpio
为避免使用数据线,可通过wifi通信,前提是手机与pc处于同一局域网
adb tcpip 5555 //这一步,必须通过数据线把手机与pc连接后再执行 adb connect <手机ip>
adb disconnect //断开wifi连接 adb usb //切换到usb模式
ls
pwd
adb devices
adb kill-server
adb start-server
adb logcat -v process |grep 8607
logcat -c
adb logcat -s xys
adb -s 192.168.56.101:5555 logcat -s xys
adb logcat -s activitymanager | findstr "start"
"-s"选项 : 设置输出日志的标签, 只显示该标签的日志;
"-f"选项 : 将日志输出到文件, 默认输出到标准输出流中, -f 参数执行不成功;
"-r"选项 : 按照每千字节输出日志, 需要 -f 参数, 不过这个命令没有执行成功;
"-n"选项 : 设置日志输出的最大数目, 需要 -r 参数, 这个执行 感觉 跟 adb logcat 效果一样;
"-v"选项 : 设置日志的输出格式, 注意只能设置一项;
"-c"选项 : 清空所有的日志缓存信息;
"-d"选项 : 将缓存的日志输出到屏幕上, 并且不会阻塞;
"-t"选项 : 输出最近的几行日志, 输出完退出, 不阻塞;
"-g"选项 : 查看日志缓冲区信息;
"-b"选项 : 加载一个日志缓冲区, 默认是 main, 下面详解;
"-b"选项 : 以二进制形式输出日志;
adb reboot
adb get-serialno
adb reboot bootloader
adb reboot recovery
adb install <apkfile> //比如:adb install baidu.apk
adb install -s <apkfile> // 比如:adb install -s baidu.apk
adb uninstall <package> //比如:adb uninstall com.baidu.search
adb shell cat /sys/class/net/wlan0/address
adb shell am start -n <package_name>/.<activity_class_name> 例如:adb shell am start -n yf.o2o.store/yf.o2o.store.activity.loginactivity
adb shell top
adb shell top -m 6
adb shell top -n 1
adb shell procrank
adb shell kill [pid]
adb shell ps
adb shell ps -x [pid]
adb shell service list
adb shell cat /proc/meminfo
adb shell cat /proc/iomem
adb remount
adb push <local> <remote>
adb pull <remote> <local>
adb shell ls
adb shell cd <folder>
adb shell rename path/oldfilename path/newfilename
adb shell rm /system/avi.apk
adb shell rm -r <folder>
adb shell mv path/file newpath/file
adb shell chmod 777 /system/fonts/droidsansfallback.ttf
adb shell mkdir path/foldelname
adb shell cat <file>
adb shell cat /data/misc/wifi/*.conf
adb logcat -c
adb bugreport
adb shell cat /system/build.prop
adb help
adb shell monkey -v -p your.package.name 500
adb -s 192.168.244.151:5555 shell monkey -v -p com.bolexim 500
下表中, 箭头左边为keycode值,箭头右边为keycode的含义,部分用中文标注
0 –> “keycode_unknown” 1 –> “keycode_menu” 2 –> “keycode_soft_right” 3 –> “keycode_home” //home键 4 –> “keycode_back” //返回键 5 –> “keycode_call” 6 –> “keycode_endcall” 7 –> “keycode_0” //数字键0 8 –> “keycode_1” 9 –> “keycode_2” 10 –> “keycode_3” 11 –> “keycode_4” 12 –> “keycode_5” 13 –> “keycode_6” 14 –> “keycode_7” 15 –> “keycode_8” 16 –> “keycode_9” 17 –> “keycode_star” 18 –> “keycode_pound” 19 –> “keycode_dpad_up” 20 –> “keycode_dpad_down” 21 –> “keycode_dpad_left” 22 –> “keycode_dpad_right” 23 –> “keycode_dpad_center” 24 –> “keycode_volume_up” //音量键+ 25 –> “keycode_volume_down” //音量键- 26 –> “keycode_power” //power键 27 –> “keycode_camera” 28 –> “keycode_clear” 29 –> “keycode_a” //字母键a 30 –> “keycode_b” 31 –> “keycode_c” 32 –> “keycode_d” 33 –> “keycode_e” 34 –> “keycode_f” 35 –> “keycode_g” 36 –> “keycode_h” 37 –> “keycode_i” 38 –> “keycode_j” 39 –> “keycode_k” 40 –> “keycode_l” 41 –> “keycode_m” 42 –> “keycode_n” 43 –> “keycode_o” 44 –> “keycode_p” 45 –> “keycode_q” 46 –> “keycode_r” 47 –> “keycode_s” 48 –> “keycode_t” 49 –> “keycode_u” 50 –> “keycode_v” 51 –> “keycode_w” 52 –> “keycode_x” 53 –> “keycode_y” 54 –> “keycode_z” 55 –> “keycode_comma” 56 –> “keycode_period” 57 –> “keycode_alt_left” 58 –> “keycode_alt_right” 59 –> “keycode_shift_left” 60 –> “keycode_shift_right” 61 -> “keycode_tab” 62 –> “keycode_space” 63 –> “keycode_sym” 64 –> “keycode_explorer” 65 –> “keycode_envelope” 66 –> “keycode_enter” //回车键 67 –> “keycode_del” 68 –> “keycode_grave” 69 –> “keycode_minus” 70 –> “keycode_equals” 71 –> “keycode_left_bracket” 72 –> “keycode_right_bracket” 73 –> “keycode_backslash” 74 –> “keycode_semicolon” 75 –> “keycode_apostrophe” 76 –> “keycode_slash” 77 –> “keycode_at” 78 –> “keycode_num” 79 –> “keycode_headsethook” 80 –> “keycode_focus” 81 –> “keycode_plus” 82 –> “keycode_menu” 83 –> “keycode_notification” 84 –> “keycode_search”
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Android studio 解决logcat无过滤工具栏的操作
Android Studio 恢复小窗口停靠模式(Docked Mode)
Android studio保存logcat日志到本地的操作
Android Studio快捷键生成TAG、Log.x日志输出介绍
网友评论