当前位置:网站首页>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--软件相关使用技巧
- 打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
- I'd rather say simple problems a hundred times than do complex problems once
- 2022.7.5DAY597
- Study summary of postgraduate entrance examination in September
- 移动端通过设置rem使页面内容及字体大小自动调整
- 555 circuit details
- BUUCTF---Reverse---reverse1
- IDA中常见快捷键
- 01 use function to approximate cosine function (15 points)
猜你喜欢

CSAPP Bomb Lab 解析

成为优秀的TS体操高手 之 TS 类型体操前置知识储备

JMeter about setting thread group and time

Encrypt and decrypt stored procedures (SQL 2008/sql 2012)

串口通讯继电器-modbus通信上位机调试软件工具项目开发案例

Trajectory planning for multi robot systems: methods and Applications Overview reading notes

字符串格式化
![[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树](/img/ba/b2dfbf121798757c7b9fba4811221b.png)
[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树

使用 load_decathlon_datalist (MONAI)快速加载JSON数据

1324:【例6.6】整数区间
随机推荐
【作业】2022.7.6 写一个自己的cal函数
Application of OpenGL gllightfv function and related knowledge of light source
Schnuka: working principle of robot visual grasping machine visual grasping
宁愿把简单的问题说一百遍,也不把复杂的问题做一遍
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
字符串格式化
Serial communication relay Modbus communication host computer debugging software tool project development case
Encrypt and decrypt stored procedures (SQL 2008/sql 2012)
1323: [example 6.5] activity selection
Leetcode-304: two dimensional area and retrieval - matrix immutable
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
Multisim--软件相关使用技巧
HDU-2196 树形DP学习笔记
Some properties of leetcode139 Yang Hui triangle
1321:【例6.3】删数问题(Noip1994)
Learning records - high precision addition and multiplication
@Transcation的配置,使用,原理注意事项:
Applet jump to H5, configure business domain name experience tutorial
CAS mechanism