当前位置:网站首页>Appium automation test foundation ADB common commands (III)
Appium automation test foundation ADB common commands (III)
2022-06-29 07:31:00 【Test - Eight Precepts】
10、 send out ⽂ Pieces arrive at ⼿ machine
adb command :adb push Computer terminal ⽂ Piece path \ Need to send ⽂ Pieces of ( full name ) /⼿ Path of machine side storage
Tips :
- Android The root directory of the mobile phone memory card is
sdcardCatalog .( Fixed ) - Note the direction of the slash in the table of contents .
Example :
Put the table ⾯ Of test.txt File sent to ⼿ machine sdcard⽬ Record
C:\Users\L>adb push C:\Users\L\Desktop\test.txt /sdcard
C:\Users\L\Desktop\test.txt: 1 file pushed, 0 skipped. 0.0 MB/s (36 bytes in 0.003s)
C:\Users\L> Tips : We can drag the file directly to the command line terminal , The path and file name of the file are automatically generated .
Let's get to Android File manager in simulator to view test.txt Whether the file received .

The contents of the open file are the same .
11、 from ⼿ Machine pulling ⽂ Pieces of
adb command :adb pull ⼿ Machine end path / Pull ⽂ Piece name ( comprehensive ) \ Computer side storage ⽂ Piece path
Example :
take ⼿ machine /sdcard⽬ On record test.txt⽂ Pieces of , Send to the computer desk ⾯
C:\Users\L>adb pull /sdcard/test.txt C:\Users\L\Desktop
/sdcard/test.txt: 1 file pulled, 0 skipped. 0.0 MB/s (36 bytes in 0.002s)
C:\Users\L> The desktop will receive test.txt⽂ Pieces of .
Be careful : In practice , Try not to use Chinese as the file name , The test may not work well .
12、 see ⼿ lucky chance ⾏⽇ Records
adb command :adb logcat
As long as the Android mobile phone / Operation of simulator , Will be recorded in the log .
Android The log of the system is divided into two parts , At the bottom Linux Kernel log output to /proc/kmsg,Android Log output to /dev/log.
(1)Android journal
Command format :
[adb] logcat [<option>] ... [<filter-spec>] ... Common usage is listed as follows :
(2) Filter logs by level
Android The log of is divided into the following priorities (priority):
- V —— Verbose( The minimum , Output the most )
- D —— Debug
- I —— Info
- W —— Warning
- E —— Error
- F —— Fatal
- S —— Silent( The highest , Output nothing )
Filtering logs by a certain level will output logs of that level and above .
such as , command :
adb logcat *:W Will Warning、Error、Fatal and Silent Log output .
( notes : stay macOS I need to give *:W In this way * As tag The parameters of are double quoted , Such as adb logcat "*:W", Otherwise, it will report a mistake no matches found: *:W.)
(3) Press tag And level filtering logs <filter-spec> There can be more than one <tag>[:priority] form .
such as , command :
adb logcat ActivityManager:I MyApp:D *:S
Indicative output tag ActivityManager Of Info Above level log , Output tag MyApp Of Debug Above level log , And others tag Of Silent The level of log ( That is to shield others tag journal ).
(4) Log format
It can be used adb logcat -v <format> Option to specify the log output format .
Log support is as follows <format>:
- brief
The default format . The format is :
<priority>/<tag>(<pid>): <message>
Example :
D/HeadsetStateMachine( 1785): Disconnected process message: 10, size: 0 - process
The format is :
<priority>(<pid>) <message>
Example :
D( 1785) Disconnected process message: 10, size: 0 (HeadsetStateMachine) - tag
The format is :
<priority>/<tag>: <message>
Example :
D/HeadsetStateMachine: Disconnected process message: 10, size: 0 - raw
The format is :
<message>
Example :
Disconnected process message: 10, size: 0 - time
The format is :
<datetime> <priority>/<tag>(<pid>): <message>
Example :
08-28 22:39:39.974 D/HeadsetStateMachine( 1785): Disconnected process message: 10, size: 0 - threadtime
The format is :
<datetime> <pid> <tid> <priority> <tag>: <message>
Example :
08-28 22:39:39.974 1785 1832 D HeadsetStateMachine: Disconnected process message: 10, size: 0 - long
The format is :
[ <datetime> <pid>:<tid> <priority>/<tag> ] <message>
Example :
[ 08-28 22:39:39.974 1785: 1832 D/HeadsetStateMachine ] Disconnected process message: 10, size: 0
The specified format can be used at the same time as the above filter . such as :
adb logcat -v long ActivityManager:I *:S
(5) Clear the log
The order is as follows :
adb logcat -c
a key : Supporting learning materials and video teaching
So here I have carefully prepared the detailed information of the above outline in The link below is as follows


边栏推荐
- [translation] E-Cloud. Large scale CDN using kubeedge
- ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
- Comment choisir les fournisseurs de marques CRM dans l'industrie du vêtement?
- ES 查询语法
- VPS是干嘛用的?有哪些知名牌子?与云服务器有什么区别?
- 机器学习笔记 - 时间序列的混合模型
- uva10891
- Do you really understand "binder copy once"?
- 【翻译】e-Cloud。使用KubeEdge的大规模CDN
- Redis (4) of NoSQL database: redis new data type
猜你喜欢

Machine learning notes - time series prediction using machine learning

Reflection modification final

Exploring the depth of objects in JVM series

tf.count_nonzero

通过keyup监听textarea输入更改按钮样式

你真的懂 “Binder 一次拷贝吗“?

What you should know about databases

Redis (4) of NoSQL database: redis new data type

Autosar SWC在Simulink中Parameter的使用
![[QNX Hypervisor 2.2用户手册]6.2.1 Guest之间通信](/img/3d/6a0cde206a09a7ef03038fb99cf532.png)
[QNX Hypervisor 2.2用户手册]6.2.1 Guest之间通信
随机推荐
MFC中利用CDockablePane实现悬浮窗
Markdown skill tree (7): separator and reference
flutter 仿照 uiswitch
Redis (4) of NoSQL database: redis new data type
mmclassification安装与调试
帆船动力学仿真分析
Imx6dl4.1.15 supports EIM bus (Part 2) - configuration principle analysis.
ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
Markdown 技能树(4):链接
部署Prometheus-server服务 system管理
Machine learning notes - time series prediction using machine learning
1183: patient queue
Is virtual DOM really the fastest?
Markdown 技能树(8):代码块
Two ways to write throttling - recently seen
VPS是干嘛用的?有哪些知名牌子?与云服务器有什么区别?
施努卡:什么是视觉定位系统 视觉定位系统的工作原理
Beanpostprocessor and beanfactorypostprocessor
What is a Test Architect
Alternative writing of if else in a project