android中查看系统日志,怎么检测android日志

首页 > 实用技巧 > 作者:YD1662023-06-02 14:28:36

工作中常用的Android系统ADB命令收集如下:先收藏以备以后查阅!

adb --help //adb帮助 adb start-server //启动adb server adb kill-server //关闭adb server adb devices //获取设备号 adb logcat //查看系统日志 adb bugreport //打印dumpsys、dumpstate、logcat的输出 adb install //安装应用 adb uninstall //卸载应用 adb pull 手机路径 电脑路径 //将手机中的文件拷贝到电脑中 adb push 手机路径 电脑路径 //发送文件到手机中 adb reboot //手机重启 adb reboot recovery //重启到Recovery中 adb reboot fastboot //重启到fastboot中 adb root //获取root权限 adb get-serialno //获取设备序列号SN值 adb get-product //获取设备的ID adb forward tcp:5555 tcp:8000 //作为主机箱模拟器或设备的请求端口 adb connect //连接手机 (可以通过IP、设备号) adb -s 设备号 shell //进入shell adb shell pm list package //列出所有的应用包名 adb shell dumpsys package //获取手机中apk列表 adb shell screencap -p /sdcard/screen.png //截屏,保存到sdcard目录下 adb shell screenrecord sdcard/record.mp4 //屏幕录制 adb shell wm size //获取设备分辨率 adb shell pm dump 包名 //列出指定应用的dump信息 adb shell pm path 包名 //列出指定包名的apk位置 adb shell ps | grep [process] 列出指定进程的PID adb shell dumpsys meminfo [pid(package-name)] //根据PID(包名)查看进程占用内存情况 adb shell top | grep app_name //可以用来查找pid adb shell ps //打印进程信息 adb shell dumpsys batterystats >xxx.txt //查看系统耗电情况 adb shell cat /proc/meminfo //查看内存信息 adb shell cat /proc/cpuinfo //查看CPU信息 adb shell getprop ro.product.cpu.abi //获取手机的arm版本 adb shell getprop | findstr iccid //获取手机的ICCID adb shell dumpsys location| findstr "Last Know Location" //获取手机经纬度 adb shell settings get secure android_id //查询Android ID adb shell cat /sys/class/net/wlan0/address //获取手机MAC地址 adb shell getprop | grep imei //获取手机IMIE adb shell cat /system/build.prop | grep "product" //获取设备信息 adb shell ifconfig wlan0 | findstr "inet" 获取手机的IP地址 adb shell ifconfig wlan0 (wlan0 为网卡名称) adb shell ifconfig wlan0 | find "inet addr" 获取IPV4地址 adb shell ifconfig wlan0 | find "inet6 addr" 获取IPV6地址 adb shell ifconfig wlan0 | grep -e 'inet addr | inet6 addr' adb shell ifconfig wlan0 | grep -e 'inet*' 获取IPV4和IPv6地址 隐私adb log 相关命令: adb shell logcat -b all >文件路径 -----获取系统日志 adb shell logcat -v time >文件路径 -----获取系统日志 adb shell ps 查看进程ID adb shell ps > 文件路径 将进程ID输出到文件中 adb logcat -v thread time > d:\xx.txt adb bugreport > 本地路径 ------使用命令抓取284log adb shell getprop ro.product.model //获取手机名称 adb shell getprop ro.build.version.release //获取手机版本 adb shell getprop ro.product.brand //获取手机厂商 adb shell ime list -s //获取已经安装的输入法 adb shell settings get secure default_input_method //获取当前输入法 adb shell dumpsys package com.example.test | findstr versionCode //查看App版本 com.example.test 这个需要根据具体测试APP包名来替换哈 修改手机电量百分百: adb shell dumpsys battery unplug 断电 adb shell dumpsys battery set level x 设置为“x”电量 adb shell dumpsys battery reset 重置 adb shell dumpsys window windows | findstr mFocusedApp //获取当前打开的应用信息 App启动时间 adb shell am start -W 包名/启动名 示例: adb shell am start -W com.yly.drawpic/.MainActivity 解释: TotalTime:app自身启动时间 WaitTime:系统启动应用时间

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.