当前位置:网站首页>Necessary skills for mobile terminal test: ADB command and packet capturing
Necessary skills for mobile terminal test: ADB command and packet capturing
2022-07-25 05:15:00 【The elegance of testing】
Mobile Testing
It refers to the testing of mobile applications , That is, the degree to which the characteristics of the entity meet the requirements , The test environment needs to be built before the test .
1 Mobile automation environment construction
1.1 java install
java JDK
install jdk-8u181-windows-x64.exe
Configure environment variables :
JAVA_HOME:D:\developer tools\Java\jdk1.8.0_181
To configure path:%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin
verification : The input terminal :java -verison

1.2Android SDK install
decompression Android-sdk.zip
Configure environment variables ANDROID_HOME:D:\android-sdk-windows
To configure path:
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\tools
verification
The input terminal :

Install the phone emulator
The night God simulator is recommended
Startup issues
1 Night God Simulator bin Under the table of contents nox_adb.exe Need and SDK in adb.exe Versions,
2
3 take SDK platform-tools Under the adb.exe Copy to night God bin Directory change name --nox_adb.exe Replace it
Starting mode
1 Start the night God Simulator , The input terminal adb connect 127.0.0.1:62001
Verification mode

2 ADB Android Commissioning Bridge
2.1 adb Concept
adb Concept
ADB full name Android Debug Bridge, yes ⼀ A debug ⼯ have
adb It's a C/S Structure of the command line tools , It's made up of three parts ,ADB It is a bridge connecting mobile phones and computers , As long as this bridge It's set up , Then you can control your mobile phone through the computer
2.2 adb working principle
adb It consists of three parts :
Client End : Running on the pc End , Can pass adb Command to Android Application for installation 、 Unloading and debugging ;
Daemon: Daemon , shipment ⾏ In commissioning equipment ,⼿ A machine or simulator ,⽤ To receive and execute ⾏ adb command ;
Server End : Running on the pc In the middle , The client to Android On the device adb Background process connection , Responsible for managing the client and daemon communicate .
2.3 adb Common command
Package name (package): Every app Of package Is the only interface name (activity):web The link in the page
2.3.1 Get the package name and interface name commands
Application scenarios : You need to know in automated testing app The package name and activity, Get the use steps through the command : Open the application under test , Enter the command
Command format :
1adb shell dumpsys activity|findstr Focused
Example : Inquire about xxxxapp

2.3.2 adb File transfer command
Application scenarios : send out ⽂ Pieces arrive at ⼿ machine 、 from ⼿ Pull in the machine ⽂ Pieces of
send out ⽂ Pieces arrive at ⼿ Machine command format :
adb push Computer ⽂ Piece path ⼿ The machine ⽂ Clip path
Example :d On the plate apk Send to Mobile phone sdcard Under the table of contents

⼿ Pull in the machine ⽂ Command line format :
adb pull Mobile end path pc End folder

2.3.3 obtain app Starting time
Application scenarios : You need to test the startup speed of the application
Command format :
1adb shell am start -W Package name / Start name

1ThisTime : This boundary ⾯ ( activity ) Time to start ( millisecond )
2TotalTime : Should be ⽤⾃ It takes time to start = ThisTime + Should be ⽤ application And so on ( millisecond )
3WaitTime : The system shall be started ⽤ Time consuming = TotalTime + System resource start time ( millisecond )
2.3.4 Get the mobile log command
Application scenarios :bug Log information is sent to the developer , Facilitate the development of positioning issues
Use steps :
Open app – perform bug Production location – Use command – Get log information
Command format
1adb logcat
Common command
1adb logcat|findstr com.xxxxx > E:/apk/logcat.txt
First step :

The second step :

2.3.5 adb Other relevant orders

3 The mobile terminal grabs packets
Mobile packet capturing application scenario :
Analyze data by capturing packets on mobile phones , determine bug Is it the foreground or the background
Use fiddler The tool captures the simulator
3.1 pc End fiddler To configure
To configure fiddler Allow listening to https(fiddler Only grab by default http Format )
To configure fiddler Allow remote connections


3.2 Configure the parameters of the mobile terminal
1 Cell phones and computers are connected to the same network
2
3 Phone system settings - Wireless network - Click Advanced , Agent selection manual , The host name is fiddler Our computer ip Address , Port number , Namely
4fiddler Port number , With the browser ip: Keep the port number consistent , Click ok Open the mobile browser install fiddler certificate IP:8888
5 Check... After restart
Mobile Manual input IP Address and port number

Browser input IP: port give an example :192.00.211:8888, Jump to fiddler The download page ( Pictured )

Set up > More Settings > Security > Credentials below ( from SD Card installation )

ios 13 New steps
install fiddler certificate Jump

open Set up - Universal - About the machine - Certificate trust settings , take DO_NOT_TRUST_FiddlerRoot Just turn on the switch

Grab bag example : Baidu browser – Input box input ‘xx education ’

Last : It can be in the official account : Sad spicy bar ! Get one by yourself 216 Page software testing engineer interview guide document information 【 Free of charge 】. And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
Now I invite you to join our software testing learning exchange group :【746506216】, remarks “ The group of ”, We can discuss communication software testing together , Learn software testing together 、 Interview and other aspects of software testing , There will also be free live classes , Gain more testing skills , Let's advance together Python automated testing / Test Development , On the road to high pay .
Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One Key triple connection !
Software Test Engineer self-study tutorial :
Interface performance test — Software testers will 618 Analysis of actual combat scenes
边栏推荐
- 一篇文章带你读懂Redis的哨兵模式
- HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier
- What about reinstalling win11 system?
- Learning records [email protected] R & D effectiveness measurement indicators
- Luogu p4281 [ahoi2008] emergency gathering / gathering solution
- Deep error
- Implementation of recommendation system collaborative filtering in spark
- 基于云原生的私有化 PaaS 平台交付实践
- AUTOSAR from getting started to mastering 100 lectures (105) - protection mechanism of AUTOSAR timing for functional safety
- When we talk about immutable infrastructure, what are we talking about
猜你喜欢

Forwarding and sharing function of wechat applet

Implement is by yourself_ base_ of

Leetcode55. Jumping game

An article takes you to understand the sentinel mode of redis
![[globally unique ID] how to handle the ID primary key after dividing the database and table?](/img/a1/800ee868b74ce5d98956d4a0e2c075.png)
[globally unique ID] how to handle the ID primary key after dividing the database and table?

85 distributed project construction

【微信小程序】拍卖商品详情页设计与交互实现(包含倒计时、实时更新出价)

The 6th "Blue Hat Cup" National College Students' Cyber Security Skills Competition writeup

Pychart configuration pyqt5

龙蜥社区发布首个 Anolis OS 安全指南 为用户业务系统保驾护航
随机推荐
Sword finger offer II 012. the sum of the left and right subarrays is equal
Introduction to CpG control network
Now the operator wants to check the answer details of all user questions from Zhejiang University. Please take out the corresponding data
Leetcode55. Jumping game
绕过 Web 应用程序中的 XSS 过滤器
Valley p2420 let's XOR solution
Teach you how to locate unreasonable SQL? And optimize it
Compile ue5.0
rhcsa暑假第三天
初步了解Panda3d粒子系统
Logu p3398 hamsters find sugar solution
[untitled]
Docker builds MySQL master-slave replication
Learning records [email protected] R & D effectiveness measurement indicators
js 页面增加过渡层
微信小程序相关操作示例
Androd releases jitpack open source project (gradle7.2)
Web: compiling big refactoring from 10 to 1
When image component in wechat applet is used as background picture
Implement is by yourself_ class