当前位置:网站首页>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 !
边栏推荐
- 深入理解Apache Hudi异步索引机制
- Why is the reflection efficiency low?
- Some properties of leetcode139 Yang Hui triangle
- [higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
- 电表远程抄表拉合闸操作命令指令
- 2022.7.3DAY595
- IIC Basics
- Prototype object in ES6
- Review of the losers in the postgraduate entrance examination
- 移动端通过设置rem使页面内容及字体大小自动调整
猜你喜欢
【二开】【JeecgBoot】修改分页参数
Yarn的基础介绍以及job的提交流程
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
原型与原型链
高级软考(网络规划设计师)该如何备考?
XML configuration file parsing and modeling
Some superficial understanding of word2vec
使用U2-Net深层网络实现——证件照生成程序
深入分析ERC-4907协议的主要内容,思考此协议对NFT市场流动性意义!
555 circuit details
随机推荐
1321:【例6.3】删数问题(Noip1994)
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
[homework] 2022.7.6 write your own cal function
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
Experience sharing of software designers preparing for exams
ArrayList thread insecurity and Solutions
Application of OpenGL gllightfv function and related knowledge of light source
Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
Hdu-2196 tree DP learning notes
Use the fetch statement to obtain the repetition of the last row of cursor data
gym安装踩坑记录
深入理解Apache Hudi异步索引机制
[dai6] mirror image of JZ27 binary tree
OpenGL glLightfv 函数的应用以及光源的相关知识
. Net configuration system
P1223 排队接水/1319:【例6.1】排队接水
[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树
555 circuit details
JS实现链式调用
Summary of router development knowledge