常用adb指令

adb shell am force-stop com.mob.mc.demo 强制杀死包进程
adb shell am start -s 包名/xxxActivity,eg:adb shell am start -S com.mob.mobpush.demo/com.mob.demo.mobpush.SplashActivity 启动activity
# 安卓8.1之前:adb shell dumpsys activiady | findstr "mFocusedActivity"
# 安卓8.1之后:adb shell dumpsys activity | findstr "mResume"

查看某个端口详情:
(linux)netstat -anp |grep 3306
(Mac ) lsof -i tcp:port
(Windows) netstat -ano |findstr 3306


查看某个进程详情:
(linux)ps -aux | grep pid
(mac)ps -ef |grep pid
(windows) tasklist|findstr pid

杀死某个进程
Linux : kill -9 pid
Windows : taskkill /pid pid号 /f

 

json里获取每个字段的value值:response.then().extract().path("data.id")

-----------------------

.adb获取设备信息
获取手机系统信息: adb shell "cat /system/build.prop | grep "product""
获取手机设备型号: adb shell getprop ro.product.model
获取手机厂商名称: adb shell getprop ro.product.brand
获取手机系统版本: adb shell getprop ro.build.version.release

adb shell getprop可以看所有信息
adb shell ps "| grep com.mob.mobpush.demo"

 

获取当前activity:adb shell dumpsys activity|grep Resume
 
启动特定activity:adb shell am start -n cn.sharesdk.demo/.MainActivity
 
 
获取IMEI码:adb shell service call iphonesubinfo 1
 
 
 
adb tcpip 5555
adb connect xxxxx
 
 
adb shell netcfg
posted @ 2021-04-14 19:45  拂晓lu  阅读(83)  评论(0编辑  收藏  举报