How to locate Android Application elements using uiautomatorviewer in Ubuntu

UI Automator Viewer(UIautomatorviewer):
The user needs to Identifying Android application (AUT) objects for automating any android application using Appium. UIautomatorviewer such a GUI tool which provided by android SDK, to support automated, functional UI testing on android application. UIautomatorviewer provides a convenient visual interface for scanning and analyzing the UI components of an Android application. Users can inspect the UI of an android application in order to find out the hierarchy and view different properties (id, class,  text etc) of the element.

1. Connect your Android device with development machine(USB debugging mode should be enabled) or start emulator like Genymotion emulator
2. Open a terminal (Ctrl+Alt+T) and navigate to <android-sdk>/tools/
3. Run the tool with this command
./uiautomatorviewer
uiautomatorviewer window will show.
4. Open desired android application in your android phone or emulator
5. Click on the devices icon at the top right corner. It will start taking the UI XML snapshot of the screen currently opened in the device.
6. process to capture device screenshot.
7. After that, the snapshot of your device screen in the uiautomatorviewer window.
1. Left side: Android app's screenshot which is open in android device or emulator
2. Right side top part: Android app's UI element's hierarchy view
3. Right side bottom part: The property detail of selected element
8. Select button 9 to view it's different properties as shown in bellow image.

5 comments:

  1. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Germany Education Consultants in Chennai

    ReplyDelete
  2. In this article, the information about to locate Android Application elements using uiautomatorviewer is awesome and greatly appreciated.
    Every snaps looks cool and very clear explanation.
    Thank you!

    -by Vignesh from Way2Smile Top rated Mobile App Development Company in Chennai

    ReplyDelete