当前位置:网站首页>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




边栏推荐
- Tensorflow realizes verification code recognition (I)
- Redis lock Optimization Practice issued by gaobingfa
- 开启 Chrome 和 Edge 浏览器多线程下载
- 通过进程PID获取可执行文件路径(QueryFullProcessImageName)
- CString getbuffer and releasebuffer instructions
- 驱动与应用程序通信
- QT use qzxing to generate QR code
- socket. IO build distributed web push server
- Visual upper system design and development (Halcon WinForm) -5 camera
- Matlab r2011b neural network toolbox precautions
猜你喜欢

Halcon与Winform学习第二节

Popular understanding of linear regression (I)
![[cloud native training camp] module VIII kubernetes life cycle management and service discovery](/img/87/92638402820b32a15383f19f6f8b91.png)
[cloud native training camp] module VIII kubernetes life cycle management and service discovery

How to use annotations such as @notnull to verify and handle global exceptions

C语言刷题~Leetcode与牛客网简单题

Unityshader - materialcapture material capture effect (Emerald axe)

秒杀系统3-商品列表和商品详情

Popular understanding of linear regression (II)

Redis cache penetration, cache breakdown, cache avalanche solution

WinDbg analysis dump file
随机推荐
Relationship between truncated random distribution and original distribution
PyTorch crop images differentiablly
Wechat payment -jsapi: code implementation (payment asynchronous callback, Chinese parameter solution)
Jvm-04-runtime data area heap, method area
Introduction series of software reverse cracking (1) - common configurations and function windows of xdbg32/64
软件逆向破解入门系列(1)—xdbg32/64的常见配置及功能窗口
Introduction to redis master-slave, sentinel and cluster mode
【日常训练】395. 至少有 K 个重复字符的最长子串
do{}while()的妙用
Visual host system design and development (Halcon WinForm)
Visual upper system design and development (Halcon WinForm) -5 camera
Kubernetes帶你從頭到尾捋一遍
Digital image processing -- popular understanding of corrosion and expansion
Jvm-03-runtime data area PC, stack, local method stack
Halcon and WinForm study section 2
【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
How to use annotations such as @notnull to verify and handle global exceptions
Unity功能——Unity离线文档下载及使用
Detailed explanation of string function and string function with unlimited length
Detailed pointer advanced 2