adb 获取Android手机信息命令(1)

@set version=1.7.2Normal
@echo =============================================================
@echo II                     Log抓取工具                      II
@echo II                     1.7.2  Normal                    II

@echo =============================================================

@adb devices

@echo   1.  开始创建目录

@set /p dirName=请输文件夹名称并回车确认,或直接回车使用默认名称:
@if defined dirName (
    @echo  dirName = [%dirName%]
) else (
    @set dirName=TECON_%version%_pctime_%DATE:~0,4%-%DATE:~5,2%-%DATE:~8,2%
    @echo  dirName = [%dirName%]
)

@mkdir %dirName%
@set pcTime= %DATE% %TIME:~0,8%

@echo  Logtool %version%  >> %dirName%/pcTime
@echo  %pcTime%  >> %dirName%/pcTime

adb shell date > %dirName%/phoneTime
@echo       创建目录结束
@echo ---------------------------------------------------
@echo   2.  开始抓取截图
@echo 。。。。。。。。。。。。。。。。。。。。。。。。。。
@echo I  注意:                                         I
@echo I      当手机陷入异常状态,截图失败时             I
@echo I      脚本会卡在下面不动                         I
@echo I      若遇到这种情况,请按一次“ctrl+c”组合键   I
@echo I      若出现"^C终止批处理操作吗(Y/N)?"           I
@echo I      请再按一次“ctrl+c”组合键                 I
@echo I      当“3.  抓取进程信息”出现后               I
@echo I      表示脚本完成截图步骤,开始执行后续操作     I
@echo 。。。。。。。。。。。。。。。。。。。。。。。。。。
@adb shell screencap -p /sdcard/PrintScreen.png
@adb pull /sdcard/PrintScreen.png %dirName%/PrintScreen.png
@echo       抓取截图结束
@echo ---------------------------------------------------
@echo   3.  开始抓取内核进程列表
@adb shell ps > %dirName%/ps
@echo       抓取内核进程列表结束
@echo ---------------------------------------------------
@echo   4.  开始抓取CPU信息
@adb shell dumpsys cpuinfo > %dirName%/dump_cpuinfo
@echo       抓取CPU信息结束
@echo ---------------------------------------------------
@echo   5.  开始抓取内存信息
@adb shell dumpsys meminfo > %dirName%/dump_meminfo
@echo       抓取内存信息结束
@echo ---------------------------------------------------
@echo   6.  开始抓取电量信息
@adb shell dumpsys battery > %dirName%/dump_battery
@echo       抓取电量信息结束
@echo ---------------------------------------------------
@echo   7.  开始抓取mobilelog & aee_exp & anr
@adb pull /storage/sdcard0/mtklog/mobilelog %dirName%/mtklog/mobilelog
@adb pull /storage/sdcard1/mtklog/mobilelog %dirName%/mtklog/mobilelog

@adb pull /storage/sdcard0/mtklog/aee_exp %dirName%/mtklog/aee_exp
@adb pull /storage/sdcard1/mtklog/aee_exp %dirName%/mtklog/aee_exp

@adb pull /storage/sdcard0/mtklog/anr %dirName%/mtklog/anr
@adb pull /storage/sdcard1/mtklog/anr %dirName%/mtklog/anr
@echo       抓取mobilelog & aee_exp& anr结束
@echo ---------------------------------------------------

@echo   8.  开始抓取ANR信息
@adb pull /data/anr %dirName%/anr
@echo       抓取ANR信息结束
@echo ---------------------------------------------------
@echo   9.  开始抓取db信息
@adb pull /data/aee_exp %dirName%/data_aee_exp
@echo       抓取db信息结束
@echo ---------------------------------------------------
@echo   10.  开始抓取存储器分区信息
@adb shell df > %dirName%/df
@echo       抓取存储器分区信息结束
@echo ---------------------------------------------------
@echo   11. 开始抓取特殊信息
@adb pull /data/mobilelog %dirName%/data_mobilelog
@adb pull /data/core %dirName%/data_core
@adb pull /data/tombstones %dirName%/tombstones
@echo       抓取特殊信息结束
@echo ---------------------------------------------------
@echo   12. 开始抓取全部安装包信息
@cd %dirName%
@mkdir packageInfo
@cd ..
@adb shell pm list package > %dirName%/packageInfo/packageList
@adb shell pm list package -f > %dirName%/packageInfo/packageDirList
@adb shell pm list package -d > %dirName%/packageInfo/disabledPackageList
@adb shell pm list package -s > %dirName%/packageInfo/systemPackageList
@adb shell pm list package -3 > %dirName%/packageInfo/thirdPackageList
@adb shell pm get-install-location >> %dirName%/packageInfo/otherInfo
@adb shell pm list users >> %dirName%/packageInfo/otherInfo
@echo       抓取全部安装包信息结束

@echo ===================================================
@echo II                      结束                     II
@echo ===================================================

pause

获取亮度信息: adb shell cat /sys/class/leds/lcd-backlight/brightness

posted @ 2017-06-14 14:42  蒋励  阅读(2523)  评论(0编辑  收藏  举报