Appium 1.6.3, Tips for Identifying IDs, elements, and XPath values

appium 163


We’ve been seeing a lot of talk from users on Appium regarding the changes that have come out of the Appium 1.6.0 release. One of the biggest changes are the Appium inspector missing with Appium.

We’ve done a lot of research and we wanted to provide you the options that are available to work around this issue. 

One of the tools that’s available that we use internally here on projects is Macaca.

Macaca was developed to run Appium with multiple selenium session in a single test. But there’s a very special tool within it that was updated to support the new instrumentation from Apple XCUITests.

The tool also has the ability to pull Xpath values for Android as well! #Winning

To install this tool you can follow the instructions on the repository in the link  or you can follow them below!

**These instructions are under the assumption you have Appium installed locally already and Homebrew**

Download and follow our free Appium beginner’s guide to build up your Appium environment!

  1. Open up Terminal and run “ npm install macaca-cli -g
  2. After install is complete, verify it was installed correctly, run “ macaca doctor
    1. If the error shows: “Command Line Tools: ios_webkit_debug_proxy is uninstalled”
    2. Run, ” brew install ios-webkit-debug-proxy
    3. Then Run “ macaca doctor
    4. Everything should be green
  3.  When you have confirmed the installation was correct you should see
  4. Next, run ” npm install app-inspector -g ” 
  5. After install is complete you should see that the words “BUILD SUCCESSFUL” in the logs.
  6.  Launch a simulator and grab the DEVICE_ID or UUID of the simulator.
    1. To get the DEVICE_ID/UUID for iOS, run the following
    2.  ” xcrun simctl list “
    3. Find the device name of the simulator which shows booted like below: 
    4. To use an android device or simulator, run the following
      1. “adb devices”
  7.  Copy the UUID and then run,” app-inspector -u YOUR-DEVICE-ID* Make sure simulator is booted first before running*
  8. When the process is finished, it will load a new window with the view hierarchy loaded and BRAVO! you now have a app inspector. We’re not done yet though!
  9. ** For iOS** Next we need to load the app we want to inspect to the device.
    1. You can launch the simulator from Xcode and deploy the app, *** If you deploy the app this way after starting the app inspector server you will have to kill the server and relaunch after the app has been deployed OR
    2. You can install it if you have a .app file already built locally
      1.  Run ” xcrun simctl install YOUR-DEVICE-ID ~/PATH-TO-.APP/
    3. Launch the application you installed to simulator
  10. For Android you can load any application via adb
    1. adb install example.apk
    2. For simulator ” adb install -s example.apk
  11. Now you if you go back to the page that loaded the view hierarchy, hit refresh and the app view will load.
  12.  If you click on a element in the view, it will highlight where that element corresponds to in the view like below: 

OR You can select the element from the tree and it will highlight it on the view.

On the right hand side you will see that it will also include the Xpath

 ex: “//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeTabBar[1]/XCUIElementTypeButton[4]

That’s it! If you look for a way to build up an ideal Appium test environment for yourself, download this beginner’s guide to learn step-by-step instructions.

Now you can use the tool to view and identify elements in the view hierarchy.

Let’s us know in the comments of any other tools or if you have a different method we would love to hear it! 

The Beginner’s Guide of Using Appium for Mobile App Testing

Learn all the basics about Appium, how to set it up and how to use it for mobile app testing.


  • armate arjun

    Can you please help post the same for windows machine. I followed the steps on windows i was able to install Macaca but if i give the command as app-inspector -u deviceid, it says as cant find module UI-Automator client. Please help.

    • Maik Broszonn

      You need to install the macaca android driver. Install via -> npm i macaca-android –save

      • armate arjun

        Hi Maik, Thanks so much for the help, i was able to install it, i will try running it tomorrow and let you know my feedback. Thanks again.

  • MallikarjunaReddy Duvoori

    Hi Team,
    After running this command app-inspector -u 876FFC48-37D3-408F-A4D4-F802C2923FTR
    am facing below error

    BPAs-MacBook:~ bpaqa$ app-inspector -u 876FFC48-37D3-408F-A4D4-F802C2923FTR

    >> xctest-client start with port: 8900

    >> WebDriverAgent version: 1.0.41

    >> app-inspector:66:44 [master] pid:2843 undefined

  • MallikarjunaReddy Duvoori

    Once i run this command “xcrun simctl list”

    No Simulator is booted up, all are shutdown, plz refer screenshot

    • Shawn Edge

      Hi, This is because you didn’t build your app to a simulator. Please see this step: Launch a simulator and grab the DEVICE_ID or UUID of the simulator.

      You can launch the simulator without building the app to it by opening Xcode, then go to Xcode -> Open Developer Tools -> “Simulator”

  • MallikarjunaReddy Duvoori

    Hello Team,
    Can we inspect elements from Real iOS Device instead of simulator? what are the steps to do ?

    • Shawn Edge

      Hi Yes, It can be used to inspect real devices same steps above apply only instead of using the simulator you would grab the UUID of the real device. This can be done with the following: run instruments -s devices in Terminal