当前位置:网站首页>Appium automation test foundation - Supplement: app package name and appactivity
Appium automation test foundation - Supplement: app package name and appactivity
2022-06-28 02:10:00 【Test - Eight Precepts】
1、 Package name
Package name (appPackage) stay Android In the system, it is a judgment App Unique identification of , Different App Can have the same name , But its package name cannot be the same .
For example, I can compile and generate a App Also called “ WeChat ”, But I App The package name of cannot be com.tencent.mm( Wechat package name ), If the package name I specified is consistent with wechat , Then only these two can be installed on a mobile phone App One of them .
- Speaking of this, many people will have questions , As like as two peas, WeChat will be the same as anyone who has done the same thing. App, The name and package name are the same as wechat , How can I tell ?
Android In order to prevent this , Also made a thing called signature , Generally, we don't have a wechat signature , So it can be identified by signature App Whose is it , If you are interested, you can learn about the signature , I won't go into that here .
Here are several ways to view package names :
(1) Look at the source code
Usually we test App All from their own companies App, So when the source code , We can easily know its package name .
Find... In the project directory “AndroidManifest.xml” The file of ( Is the configuration file in the project ), After opening , Here's the picture :

So that we can find package This item can be viewed .
(2) View mobile system settings
Let me introduce Google native system here , Some other millet 、 Meizu and other customized systems also have similar viewing methods .
Operation steps :“ Set up ” -> “ application ” -> “ Running ”( This step needs attention )-> Select the app you want to view .
This time you can see , Here's the picture :

(3) see /data/data/ Catalog
When we install an app , The system will be in /data/data/ Create a directory under the directory , And the file name is the package name of the current application , Let's take a look at the files in this directory on the mobile phone :

If you know what you want to see App A keyword in the package name , It will find the package name of your application faster , Otherwise, it is recommended to use other methods . This method requires root.
(4)GT Software
GT The interface comes with this function , Download from app GT, Then select an application under test , You can see , Here's the picture :

2、 Start name
Start name (appActivity) It can also be called the startup page .
In a nutshell appActivity Refers to App The page we see in , A page is a appActivity, Usually the page that starts on the first page is called “ Startup page ”.
We're doing automated testing , Usually the first step is to start the application under test , And the way to start is to use “ Package name / Startup page ”, Therefore, we usually need to know this in the process of testing appActivity The name of .
Let me introduce several ways to view the startup page appActivity Methods .
(1) Look at the source code
Similarly, in the source code, we can directly find the start page Activity The name of . Here you need to find the project directory AndroidManifest.xml Configuration files , The file contains category The value of is android.intent.category.LAUNCHER” Of appActivity That's what we're looking for :

When we know the startup page appActivity after , You can enter the command directly :adb shell am start com.bryan.testbattery/com.bryan.testbattery.activity.MainActivity
Pull up the application .
(2)Logcat
close App, open Logcat, Then start your App, Look carefully at this time log journal , commonly tag by ActivityManager I'll record such a paragraph log, And here is the start page appActivity, Here's the picture :

(3)dump package Package name
After using the command to view , The same is to find that contains category.LAUNCHER Wording appActivity that will do .

(4)Monkey
Monkey You can set the detail level of the log , When we specify -VVV When , And specify the simulated random event as once , You can view it :

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


边栏推荐
- Deep parsing of kubernetes controller runtime
- Ten MySQL locks, one article will give you full analysis
- Self supervised learning and drug discovery
- 学习 pickle
- [Yocto RM] 2 - Yocto Project Terms
- Database query optimization: master-slave read-write separation and common problems
- How to study efficiently
- [sylixos] I2C device driver creation and use
- Interviewer asked: Inheritance of JS
- 要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
猜你喜欢

Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)

声网 VQA:将实时互动中未知的视频画质用户主观体验变可知

Cesium 点击绘制多边形(动态绘制多边形)

Numpy----np. meshgrid()

mysql面试百题集

Hi, you have a code review strategy to check!

Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection

Chapitre 4: redis

Numpy----np.tile()函数解析

Jenkins - Pipeline 语法
随机推荐
混合app的介绍
General process after reference layer reboot
Intensive reading of transformer thesis paragraph by paragraph
I/O限制进程与CPU限制进程
Data analysts too hot? Monthly income 3W? Tell you the true situation of this industry with data
【sylixos】NEW_1 型字符驱动示例
Set collection usage
【永艺XY椅】试用体验
Solon 1.8.3 release, cloud native microservice development framework
学习 pickle
Neural network of zero basis multi map detailed map
如何阅读一篇论文
[Yocto RM] 2 - Yocto Project Terms
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
[Yocto RM]3 - Yocto Project Releases and the Stable Release Process
What problems should be evaluated before implementing MES management system
205. isomorphic string
Jenkins - 邮件通知 Email Notification 插件
Database query optimization: master-slave read-write separation and common problems
Appium自动化测试基础 — ADB常用命令(一)