当前位置:网站首页>ADB utility commands (network package, log, tuning related)
ADB utility commands (network package, log, tuning related)
2022-07-07 10:34:00 【Zouch 】
List of articles
- background
- command
- - Connect to the set top box
- - View connected devices
- - Disconnect a set-top box
- - Disconnect all devices
- - obtain root jurisdiction
- - Mount file system
- - Grab network packets
- - Pull the network package to this computer cmd Execute the command current directory
- - Delete the network package in the device
- - Get set-top box device information
- - according to uri see contentProvider Middle table information
- - Open the application according to the package name and startup class name
- - Set the system parameters of application runtime
- - Kill the application process according to the package name
- - The name of the process is grep Command filter output "com.gitv.tv.launcher" Information about the process
- - Empty ( eliminate )Android Medium logcat buffer
- - see cpu Information
- - Check out the meminfo
- - Check the power information
- - Find the applied pid
- - Check the maximum memory limit of the application
- - Analyze the memory information of the application ( Is there a memory leak )
background
Recently, I went on a business trip on the site of CAAC , I am responsible for sdk Development , The Bureau outsourced the integration to colleagues in Beijing sdk Development and application , Later, I found that there are some problems in the application that need to be solved . I am Party B again , Came to the bureau to analyze the problem on site , Then feedback and solve .
But later sdk It didn't move , Some optimizations are applications ( There is a memory leak ) What needs to be done , Set top box performance may also have a certain impact .
Some practical ones are available on site adb command , Record here , Convenient for myself and my classmates to use in the future .
command
- Connect to the set top box
adb connect [ The set-top box ip]
- View connected devices
adb devices
- Disconnect a set-top box
adb disconnect [ The set-top box ip]
or
adb disconnect [ Virtual machine name ]
- Disconnect all devices
adb disconnect
- obtain root jurisdiction
adb root
- Mount file system
adb remount
When you want to go to mobile devices push Show no permission when file , Try the following instructions :
adb root
adb remount
If there is a hint read-only Words , You can continue to try to execute the command :
adb root
adb disable-verity
adb reboot Restart and then adb remount that will do .
When you want to push When entering a folder under a specific path, you can use : adb shell mount -o rw,remount / route / route
notes :adb remount Is equivalent to adb shell mount -o rw,remount,rw /system
- Grab network packets
( stay cmd The directory where the window executes the command is placed tcpdump file , Used when grabbing bags )
adb shell tcpdump -i any -p -s 0 -w /data/data/capture.pcap
Composite key : ctrl + C
You can stop capturing packets .
- Pull the network package to this computer cmd Execute the command current directory
adb pull /data/data/capture.pcap
- Delete the network package in the device
adb shell
rm /data/data/capture.pcap
- Get set-top box device information
adb shell getprop
- according to uri see contentProvider Middle table information
adb shell content query --uri [ Tabular uri]
Example :
adb shell content query --uri content://stbauthinfo/authentication
give the result as follows :
Row: 0 _id=131, name=epg_server, value=http://183.224.21.144:33200
Row: 1 _id=132, name=refreshTime, value=915738
Row: 2 _id=133, name=licence, value=1
Row: 3 _id=134, name=Password, value=969256
Row: 4 _id=135, name=username, value=dsw1878700035901
Row: 5 _id=136, name=user_token, value=tj3kkvhyh0d4yS-StkL2k8844
Row: 6 _id=137, name=platform, value=YNYDHW
Row: 7 _id=138, name=userGroup, value=0
Row: 8 _id=139, name=platformType, value=1
Row: 9 _id=140, name=g_token, value=ee422c5fcf70dda06b3fb295d39ef8b0f5aca34ed45bcb4c
Row: 10 _id=141, name=isSW, value=0
- Open the application according to the package name and startup class name
adb shell am start -n [pkgId]/[launchClassName]
Example :
adb shell am start -n com.utstar.smartTV/yanhua.tv.activity.Dispatcher
- Set the system parameters of application runtime
adb shell setprop [ Custom parameters key] [ The parameter to be set corresponds to value]
Example :
adb shell setprop debug.ottsdk.config 1
notes : After the device restarts , The set parameter value will be invalid ; But restarting the application will not fail .
- Kill the application process according to the package name
adb shell am force-stop [pkgId]
Be careful : Sometimes it may not be successful .
Because in android8.1 In the code of the system :
if (app.persistent && !evenPersistent) {
// we don't kill persistent processes
continue;
}
Application android:persistent=“true”,true Don't let force-stop, Of course, the process also exists .
So if you want to force killing, you can do this : Find the application process id, And then by order kill -9 [ process id]
You can force the killing process .
- The name of the process is grep Command filter output “com.gitv.tv.launcher” Information about the process
adb shell top | grep com.gitv.tv.launcher
For more related commands, please read adb shell top command .
- Empty ( eliminate )Android Medium logcat buffer
adb logcat -c
It is recommended to crawl logs , Execute the command once .
Prevent fetching redundant logs , Ensure the accuracy of log capture , It is convenient to analyze the positioning problem .
- see cpu Information
adb shell dumpsys cpuinfo
- Check out the meminfo
adb shell cat /proc/meminfo
The instructions are as follows :
MemTotal: 688576 kB Total memory
MemFree: 153736 kB Free memory
MemAvailable: 339884 kB Available memory
Buffers: 16 kB The buffer size given to the file
Cached: 267672 kB Cache memory
SwapCached: 36 kB The size of the swap space used by the cache
Active: 222900 kB Cache page file size in active use
Inactive: 123700 kB Not often used to tell buffer memory file size
Active(anon): 31800 kB Active anonymous memory ( Memory allocated on the heap in the process , Yes, it is malloc Allocated memory )
Inactive(anon): 57272 kB Inactive anonymous memory
Active(file): 191100 kB Active file Memory
Inactive(file): 66428 kB Inactive file Memory
Unevictable: 0 kB Memory pages that cannot be freed
Mlocked: 0 kB mlock() Memory size locked by system call
SwapTotal: 2097148 kB Total size of swap space
SwapFree: 2096884 kB Free swap space
Dirty: 0 kB Waiting to be written back to disk size
Writeback: 0 kB The size being written back
AnonPages: 78876 kB The size of the unmapped page
Mapped: 28556 kB Device and file mapping size
Shmem: 10160 kB The size of shared memory that has been allocated
Slab: 102916 kB Kernel data structure cache size
SReclaimable: 49616 kB Recoverable slab Size
SUnreclaim: 53300 kB Non recyclable slab Size
KernelStack: 4416 kB kernel Memory consumed
PageTables: 6028 kB Manage the size of the index table for memory paging
NFS_Unstable: 0 kB Unstable page table size
Bounce: 0 kB Allocate a temporary... In low-end memory buffer As a jump , Copy the cache data in high-end memory to the memory consumed here
WritebackTmp: 0 kB USE Memory for temporary write back buffer
CommitLimit: 2441436 kB The total amount of memory that the system actually allocates
Committed_AS: 308028 kB The total amount of memory currently allocated
VmallocTotal: 34359738367 kB Virtual memory size
VmallocUsed: 179588 kB The size of virtual memory that has been used
VmallocChunk: 34359310332 kB malloc The maximum logical contiguous memory size that can be allocated
HardwareCorrupted: 0 kB Total size of deleted memory pages ( When the system detects a hardware failure in memory )
AnonHugePages: 6144 kB anonymous HugePages Number
CmaTotal: 0 kB Total continuous available memory
CmaFree: 0 kB Free continuous memory
HugePages_Total: 0 reserve HugePages Total number of
HugePages_Free: 0 Not yet allocated in the pool HugePages Number
HugePages_Rsvd: 0 Represents the pool that has been allocated but not yet used by the application HugePages Number
HugePages_Surp: 0 It's worth saying that when you start to configure 20 A big page , Now change the configuration to 16, Then this parameter will be displayed as 4, Generally, the configuration is not modified , The values are all 0
Hugepagesize: 2048 kB The size of each large page
DirectMap4k: 108416 kB mapping TLB by 4kB The amount of memory
DirectMap2M: 940032 kB mapping TLB by 2M The amount of memory
DirectMap1G: 0 kB mapping TLB by 1G The amount of memory
- Check the power information
adb shell dumpsys battery
- Find the applied pid
adb shell
top | grep [pkgId]
Number in the first column 2185 Is the process of application pid
- Check the maximum memory limit of the application
adb shell
getprop|grep heapgrowthlimit
- Analyze the memory information of the application ( Is there a memory leak )
adb shell
dumpsys meminfo [pkgId/pid]
Please read more detailed usage and memory analysis instructions :adb shell dumpsys meminfo Detailed explanation .
Technology never sleeps ! See you next time !
边栏推荐
- Multisim -- software related skills
- HDU-2196 树形DP学习笔记
- Slurm资源管理与作业调度系统安装配置
- Study summary of postgraduate entrance examination in November
- Easyexcel read write simple to use
- 对word2vec的一些浅层理解
- 施努卡:机器视觉定位技术 机器视觉定位原理
- Sword finger offer 38 Arrangement of strings [no description written]
- 0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
- [STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
猜你喜欢
求最大公约数与最小公倍数(C语言)
对word2vec的一些浅层理解
【acwing】786. Number k
[sword finger offer] 42 Stack push in and pop-up sequence
浅谈日志中的返回格式封装格式处理,异常处理
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
【STM32】STM32烧录程序后SWD无法识别器件的问题解决方法
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
南航 PA3.1
Serial communication relay Modbus communication host computer debugging software tool project development case
随机推荐
使用U2-Net深层网络实现——证件照生成程序
IIC基本知识
TypeScript 接口继承
Common shortcut keys in IDA
Schnuka: machine vision positioning technology machine vision positioning principle
IO模型复习
多线程-异步编排
HDU-2196 树形DP学习笔记
Prototype and prototype chain
CC2530 zigbee IAR8.10.1环境搭建
求方程ax^2+bx+c=0的根(C语言)
BUUCTF---Reverse---reverse1
CC2530 ZigBee iar8.10.1 environment construction
深入理解Apache Hudi异步索引机制
P1223 排队接水/1319:【例6.1】排队接水
南航 PA3.1
ThreadLocal会用可不够
IIC Basics
ArrayList thread insecurity and Solutions
leetcode-303:区域和检索 - 数组不可变