当前位置:网站首页>App mobile terminal test [5] file writing and reading
App mobile terminal test [5] file writing and reading
2022-07-03 15:32:00 【Leo_ Eagle】
Writing files 、 Read ;
adb Command management
1. Operation of file
1.1 write in
Writing files to your phone is a common operation , Write operations are as follows .
C:\Users\Leo>adb shell
[email protected]:/ # ls
….
sdcard
…..
C:\Users\Leo>adb push G:\demo.txt /sdcard
G:\demo.txt: 1 file pushed.
C:\Users\Leo>adb shell
[email protected]:/ # cd sdcard
[email protected]:/sdcard # ls
….
Demo.txt
…..
Format : stay cmd in
Adb push pc End of the file mobile End Directory
Case study :
C:\Users\Leo>adb push G:\demo.txt /sdcard
1.2 Read
Reading files from mobile phones is also a common operation , The operation cases read are as follows .
First in sdcard establish 1 individual huawei.txt
[email protected]:/sdcard # touch huawei.txt
[email protected]:/sdcard # ls
Huawei.txt
From mobile phone pull To local pc End
C:\Users\Leo>adb pull /sdcard/huawei.txt G:\
adb: error: cannot create file/directory 'G:\': No such file or directory
C:\Users\Leo>adb pull /sdcard/huawei.txt G:\Demo
/sdcard/huawei.txt: 1 file pulled.
Format :adb pull Files on the mobile phone pc Under end path
Such as :adb pull /sdcard/huawei.txt G:\Demo
Be careful :pull In the process , Not directly pull Go to a disk , You must go to a folder ( Otherwise, it may be wrong ).
adb: error: cannot create file/directory 'G:\': No such file or directory,
2. Screen capture
During script execution , There may be mistakes , Need to intercept App( Or the screen ) Screenshot of the error , It is very helpful to analyze problems .
C:\Users\Leo>adb shell screencap /sdcard/yeshen.png
C:\Users\Leo>adb pull /sdcard/yeshen.png G:\Demo
/sdcard/yeshen.png: 1 file pulled. 1.8 MB/s (335838 bytes in 0.179s)
Be careful : The picture suffix should not be jpg. Otherwise there is a problem
3. Adb Start and shut down
By controlling adb Start of service , So as to realize the control of mobile phones .
start-up adb service
C:\Users\Leo>adb start-server
close adb service
C:\Users\Leo>adb kill-server
See who is using 5037 port
C:\Users\Leo>netstat -ano |findstr "5037"
TCP 127.0.0.1:5037 127.0.0.1:55182 TIME_WAIT 0
4. adbdevices.bat
How to achieve adb Control of services , By writing bat To achieve .
First create bat, The contents are as follows : Under the operation, you can see a flash
adb devices
Edit it as follows , Add... At the end pause, Will pause .
adb devices
pause
Such as :
AdbConnect.bat
adb connect 127.0.0.1:62025
adb devices
pause
Test intensive video
If you don't find your article enjoyable , You can see the detailed video tutorial .
《 Necessary skills for Mobile Testing 》
UI automated testing :Selenium3 automated testing
【 Test the full series of video courses 】
The learning route is as follows




边栏推荐
- Jvm-05-object, direct memory, string constant pool
- socket.io搭建分布式Web推送服务器
- Unity功能——Unity离线文档下载及使用
- Calibre LVL
- Leasing cases of the implementation of the new regulations on the rental of jointly owned houses in Beijing
- Puppet automatic operation and maintenance troubleshooting cases
- [cloud native training camp] module 7 kubernetes control plane component: scheduler and controller
- Tensorflow realizes verification code recognition (I)
- Digital image processing -- popular Canny edge detection
- QT common sentence notes
猜你喜欢

Visual upper system design and development (Halcon WinForm) -1 Process node design

Jvm-05-object, direct memory, string constant pool

Halcon与Winform学习第一节

秒杀系统2-Redis解决分布式Session问题

Detailed explanation of string function and string function with unlimited length

Unity function - unity offline document download and use

Visual upper system design and development (Halcon WinForm) -3 Image control

WinDbg analysis dump file

Jvm-02-class loading subsystem

需要知道的字符串函数
随机推荐
秒杀系统1-登录功能
qt使用QZxing生成二维码
Use percent sign in CString
CString中使用百分号
Idea does not specify an output path for the module
Popular understanding of linear regression (I)
子类隐藏父类的同名函数
Location of software installation information and system services in the registry
Win32 create window and button (lightweight)
Kubernetes - YAML文件解读
Apache ant extension tutorial
Tensorflow realizes verification code recognition (III)
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
Using notepad++ to build an arbitrary language development environment
视觉上位系统设计开发(halcon-winform)
Baidu AI Cloud helps Shizuishan upgrade the smart health care model of "Internet + elderly care services"
The state does not change after the assignment of El switch
Kubernetes advanced training camp pod Foundation
Second kill system 3 - list of items and item details
QT use qzxing to generate QR code