Android上的命令内存相关
targetProcess=com.example timeStr=`date -d today +"%Y%m%d%H%M%S"` fileName="meminfo"_$timeStr".txt" echo timeStr is:===== $timeStr echo begin dump procrank to $fileName echo $targetProcess ##dump procrank to file # adb shell procrank >> $fileName adb shell ps > phoneps.txt #因为adb shell ps出来后没行后有0D0A回车,故转为unix格式 dos2unix phoneps.txt #get process id and cat phoneps.txt | while read line do pid=`echo $line | cut -d " " -f 2` ppid=`echo $line | cut -d " " -f 3` name=`echo $line | cut -d " " -f 9` if [ "$name" == "$targetProcess" ]; then echo $line >> $fileName echo -e "\n\n----------------------prorank meminfo $targetProcess-------------------------" >> $fileName echo -e " PID Vss Rss Pss Uss cmdline" >> $fileName adb shell procrank |grep $pid >> $fileName echo -e "\n\n----------------------meminfo of $targetProcess-------------------------" >> $fileName adb shell dumpsys meminfo $targetProcess >> $fileName echo -e "\n\n------------------------showmap of $targetProcess:--------------------" >> $fileName adb shell showmap $pid >> $fileName echo -e "\n\n--------------------------showmap of ppid $ppid:------------------------------" >> $fileName adb shell showmap $ppid >> $fileName echo -e "\n\n---------------------smaps of $targetProcess:---------------------------" >> $fileName adb shell cat /proc/$pid/smaps >> $fileName fi done
相关推荐
huha 2020-10-16
magic00 2020-08-03
yangChong 2020-07-29
adb shell cd system/app rm *.apk21. 获取管理员权限: adb root22. 启动Activity: adb shell am start -n 包名/包名+类名。
蓝天梦 2020-07-28
applecarelte 2020-07-05
xiaobater 2020-07-04
QCkiss 2020-06-21
freerocker 2020-05-25
doomvsjing 2020-04-16
qingshuoyisheng 2020-04-07
安辉 2020-03-28
2、在设置好端口后就可输入命令连接:adb connect 192.168.2.36:5555,后面的:5555可以不用输入,例如我设置的:6666端口,则通过如下指令连接:。映像名称 PID 会话名
fengyeezju 2020-03-02
applecarelte 2020-02-23
Soinice 2020-02-18
woxxoole 2020-02-02
goodby 2020-01-09
蓝天梦 2020-01-02
SciRui 2019-12-29
xiaobater 2019-12-27
KarlMarxs 2019-12-19
Yyqingmofeige 2019-12-23
goodby 2019-12-16
zhaoyufei 2019-11-30
qingshuoyisheng 2019-11-15
RayDon 2010-11-03