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


边栏推荐
- How to understand query, key and value in transformer
- Web3 technology initial experience and related learning materials
- Description du format geojson (détails du format)
- Chapitre 4: redis
- fiddle如何使用代理
- 零基礎多圖詳解圖神經網絡
- Four classic training modes in comparative learning
- TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language
- Supervised, unsupervised and semi supervised learning
- Lmsoc: a socially sensitive pre training method
猜你喜欢
随机推荐
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
geojson 格式说明(格式详解)
【sylixos】NEW_1 型字符驱动示例
网络爬虫是什么
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
Intranet penetration with FRP
自监督学习与药物发现
The practice of dual process guard and keeping alive in IM instant messaging development
Appium自动化测试基础 — ADB常用命令(一)
Modular development
混合app的介绍
Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
[embedded foundation] serial port communication
How to understand query, key and value in transformer
How to optimize the "message" list of IM
MapReduce elementary programming practice
[Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)
Réseau neuronal pour la solution détaillée Multi - diagrammes de fondation zéro
Numpy----np.reshape()









