Appium Python Four: How to get the app's package and activity

Source: Internet
Author: User

See a good blog: "Android Test" "essay" To get the app's package name and start page activity

In addition to the methods on the blog, I also found two ways:

Method One: AAPT

The prerequisite is to use the SDK Manager.exe to download the Android SDK Build-tools. Here you can choose any version of the build-tools to download, I downloaded the version 23.0.1.

After downloading, you can find the tool Aapt.exe under the build-tools of the SDK, my path is: D:\android-sdk_r23.0.2-windows\android-sdk-windows\build-tools\ 23.0.1\aapt.exe.

Execute "aapt dump badging xxx.apk" to get the package and Activity.

d:\android-sdk_r23.0.2-windows\android-sdk-windows\build-tools\23.0.1>aapt Dump badging D:\appium\apks\ Zhihu_521.apkpackage:name='com.zhihu.android' ... .   ..... launchable-activity:name='com.zhihu.android.app.ui.activity.MainActivity'
Method Two: Appium analysis

Open the Appium server side and click on the Android robot icon.

Select Application path and click the Choose button to select the APK file path for the app. Select to see Appium automatically resolves the package and activity name.

Here I parse the known apk file.

For activity, check lanch activity to see all the activity lists.

Note: I will check here by default. Manactivity, the same as the AAPT tools, do not know whether it is coincidence.

Of course, it is best to take application Path and Lanch Activity unchecked after getting it.

Appium Python Four: How to get the app's package and activity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.