当前位置:网站首页>Performance optimization of common ADB commands
Performance optimization of common ADB commands
2022-07-27 05:54:00 【android framework】
Commonly used adb Command summary ( Absolutely dry )
wanderingGuy
0.365
2018.02.10 22:02:54
Number of words 673
read 4,408
This article summarizes the commonly used adb command , Familiarity with these commands can greatly improve development efficiency in some scenarios , Absolutely dry . All parameters in this paper are as follows $ start , In actual use, it can be replaced with real parameters .
One 、 start-up / Close class
start-up activity
Implicit action The way :
adb shell am start -a ${your_action_name}
Show activity The way :
adb shell am start -n y o u r p a c k a g e n a m e / {your_package_name}/ yourpackagename/{your_activity_name}
Explicit (-n) And implicit (-a) The instructions of are also applicable to services and broadcasting .
Add startup parameters
If you want to add startup parameters, continue to add the following configuration after the above command :
string type : --es ${paramterkey} ${value}
int type : --ei ${paramterkey} ${value}
boolean type : --ez ${paramter_key} ${value}
Multiple parameters are separated by spaces , Other parameter types can be used by themselves google Look up , This method also applies to service And broadcast , Take a chestnut
adb shell am start -a com.xxxx.business.action --es name ‘zhangsan’ --ei age 18
Send a broadcast
adb shell am broadcast -a ${broad_action_name}
Start the service
adb shell am startservice -n y o u r p a c k a g e n a m e / {your_package_name}/ yourpackagename/{your_service_name}
// Out of Service
adb shell am stopservice -n y o u r p a c k a g e n a m e / {your_package_name}/ yourpackagename/{your_service_name}
Launch the install application dialog
adb shell am start -a android.intent.action.VIEW -d ${your_apk_file_absolute_path} -t application/vnd.android.package-archive
For example, the path is sdcard Then the parameter can be file:///sdcard/test.apk
Force exit process
adb shell am force-stop KaTeX parse error: Expected 'EOF', got '#' at position 368: … So let's just have a script , Quite a powerful . #̲!/bin/sh # Screenshot ls…{ls_date}.png
# from SD The card is exported to the current directory of the machine
adb pull /sdcard/screenshot_${ls_date}.png .
Catch log
This is a routine operation , Basically, I can , My common configuration is as follows
// Threads 、 The process name is a key information when it comes to debugging between multiple applications
adb logcat -v threadtime > log_xxxx.txt
Check the service activity
Needless to say , A line of command prints service It's not much easier for debugging to survive
add |grep Fuzzy query can be supported
adb shell dumpsys activity services |grep ${your_service_name}
Print activity stack situation
With this order , You're worried about transparency activity Well , The printed information already covers all stack And its task And among them activity All status information for . in addition dumpsys The instructions are quite powerful , It can also print cpu、battery Wait for hardware information .
adb shell dumpsys activity activities
With this command and a parameter, the top layer can be printed directly activity name
adb shell dumpsys activity | grep mFocusedActivity
Print window situation
Same as activity similar
adb shell dumpsys window -w
With this command and a parameter, the top layer can be printed directly activity name
adb shell dumpsys activity | grep mFocusedActivity
Clear all application data
adb shell pm clear ${your_package_name}
Print apk Package information
If apk Not installed
aapt dump badging ${your_apk_file_path}
If installed
adb shell dumpsys package ${your_package_name}
Print manifest Content
aapt dump xmltree ${your_apk_file_path} AndroidManifest.xml
Kill the process executing the package name
adb shell am force-stop ${your_package_name}
Print all property information , The information is in system/build.prop In file
adb shell getprop
3、 ... and 、 performance optimization
GPU Presentation mode , An important indicator of frame rate
adb shell setprop debug.hwui.profile visual_bars ( Bar charts )
adb shell setprop debug.hwui.profile visual_lines ( Broken line diagram )
Transition drawing
// After execution, kill the process and restart
adb shell setprop debug.hwui.overdraw show
// Turn off over painting Reopen the interface to take effect
adb shell setprop debug.hwui.overdraw false
Print memory information
adb shell procrank|grep ${your_package_name}
adb shell dumpsys meminfo ${your_package_name}( More details )
activty Starting time
adb shell am start -W y o u r p a c k a g e n a m e / {your_package_name}/ yourpackagename/{your_activity_name
边栏推荐
- jenkins构建镜像自动化部署
- Es time query error - "caused_by": {"type": "illegal_argument_exception", "reason": "failed to parse date field
- Minio8.x version setting policy bucket policy
- GBASE 8C——SQL参考6 sql语法(12)
- Jenkins build image automatic deployment
- 18.卷积神经网络
- GBASE 8C——SQL参考6 sql语法(13)
- GBASE 8C——SQL参考6 sql语法(11)
- dbswitch数据迁移数据增量时如何不覆盖目标源数据
- Build a complete system in the maker education movement
猜你喜欢

10.梯度、激活函数和loss

贪心高性能神经网络与AI芯片应用研修

Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output

How to choose a good futures company for futures account opening?

使用Docker部署Redis进行高可用主从复制

jenkins构建镜像自动化部署

14.实例-多分类问题

Minimum handling charges and margins for futures companies

9.高阶操作

「中高级试题」:MVCC实现原理是什么?
随机推荐
MySQL查询操作索引优化实践
Choose futures companies with state-owned enterprise background to open accounts
18.卷积神经网络
Minio fragment upload lifting fragment size limit - chunk size must be greater than 5242880
Which futures company has a low handling fee and a high refund?
go通过channel获取goroutine的处理结果
Count the quantity in parallel after MySQL grouping
Day 4.Social Data Sentiment Analysis: Detection of Adolescent Depression Signals
Day 15. Deep learning radiomics can predict axillary lymphnode status in early-stage breast cancer
MySQL limit分页查询优化实践
Day 4.Social Data Sentiment Analysis: Detection of Adolescent Depression Signals
13.逻辑回归
2021中大厂php+go面试题(2)
GBASE 8C——SQL参考6 sql语法(11)
Graph node deployment
The main advantage of face brushing payment users is their high degree of intelligence
How does gamefi break the circle? Aquanee shows its style by real "p2e"
Analyze the maker education DNA needed in the new era
Day 8.Developing Simplified Chinese Psychological Linguistic Analysis Dictionary for Microblog
Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output