当前位置:网站首页>Necessary skills for mobile terminal test: ADB command and packet capturing
Necessary skills for mobile terminal test: ADB command and packet capturing
2022-07-21 01:45:00 【Test Xiaona】
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 ’
Learning resource sharing
Finally, thank everyone who reads my article carefully , Watching the rise and attention of fans all the way , Reciprocity is always necessary , Although it's not very valuable , If you can use it, you can take it
These materials , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful …….
If you don't want to experience it again, you can't find information when you study on your own , No one answers the question , If you insist on giving up after a few days , You can add mine below qq Group discussion and Exchange , There are also various software testing materials and technical exchanges .
边栏推荐
猜你喜欢
力扣刷题14. 最长公共前缀
力扣刷题292. Nim 游戏
网络安全—综合渗透测试-CVE-2019-15107-Webmin远程代码执行
Network security comprehensive penetration test cve-2017-12629 Apache Solr remote code execution
PHP(1)
Network security in Secondary Vocational Schools - the thinking of reverse PE reverse problem solving in 2022 National Games
AT32使用内核DWT寄存器设定延时时间
Network security - comprehensive penetration test -cve-2019-15107-webmin remote code execution
Technical analysis premint security events, how to avoid attacks?
力扣刷题26. 删除有序数组中的重复项
随机推荐
STM32 unique ID reading method
Configure dual database
展锐手机解锁
Visio使用
Scala foundation [high order function programming]
从镜像仓库工具、镜像下载加速工具、安全扫描工具理解镜像存储和镜像安全
私域流量和裂变营销的关系,什么是超级APP,我们企业能拥有吗?
微信小程序如何实现select二级下拉
Network security in Secondary Vocational Schools - the thinking of reverse PE reverse problem solving in 2022 National Games
【服务器数据恢复】某品牌ProLiant服务器raid瘫痪数据库文件损坏的数据恢复
函数方法封装——图片类型QPixmap、QImage与Mat的相互转化
Installation sequence of Yuhua Wanbao fan
“蔚来杯“2022牛客暑期多校训练营1 I Chiitoitsu(概率dp)
Flink1.15源码阅读——flink-annotations
第十天:BGP 边界网关协议
力扣刷题记录3-----34.在排序数组中查找元素的第一个和最后一个位置
如何搭建简易又安全的企业内部文件服务器?
力扣刷题238.除自身以外数组的乘积
LeetCode__301场周赛.6112. 装满杯子需要的最短总时长___贪心两法
scala基础【高阶函数编程】