Get the values for App-package and app-activity

Source: Internet
Author: User

Original link: http://sqa.stackexchange.com/questions/12373/android-app-testing-with-appium/12382#12382

I suggest the Use adb (Android Debug Bridge) tool (part of the Android SDK). So, install application under test on target Android device or emulator. And you should run application to get the current activity and the package name. So, after running app execute the following commands from command line (ANDROID-SDK/PLATFORM-TOOLS/ADB):

12grep'mcurrentfocus| Focusedapp'

And you'll get something like this:

mCurrentFocus=Window{43270790 u0 com.estrongs.android.pop/com.estrongs.android.pop.view.FileExplorerActivity} mFocusedApp=AppWindowToken{44d67b88 token=Token{435e5990 ActivityRecord{434ee320 u0 com.estrongs.android.pop/.view.FileExplorerActivity t133

So, the current activity is Com.estrongs.android.pop/.view. Fileexploreractivity and application package name are Com.estrongs.android.pop is the this case.

Steps:

    1. Install APK on device or emulator//mount the apk you want to test.
    2. Run application//running the apk you want to test.
    3. Execute from adb shell command line//execute adb shell command.
    4. Execute command to get the current activity from device (shell) Shell://execute the commands below.

    dumpsys window windows | grep -E ‘mCurrentFocus|FocusedApp‘

I hope it helps you.

Get the values for App-package and app-activity

Related Article

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.