Xcode 8 + Appium 1.6 Beta (IOS Inspector - As Beta version doesn’t have GUI yet.. ) we can use the below for inspecting the objects in IOS application
Option 1:
file:///Users/ssimakurthy/IOSInspector/Appium-iOS-Inspector/iOS%20Inspector.html
Mykola:
Usage
Execute your iOS test using Appium (by default it is expected to listen on http://localhost:4723) and set a breakpoint where you want to investigate the UI tree. Open/refresh iOS Inspector.html web page in your favourite web browser, wait for a while until the data is loaded and you are ready to go. The inspector currently supports showing of element attributes, element location by XPath and, naturally, two-way visual elements location using a screenshot and the UI tree.
Note: The Accessibility Id property can be presented as @name attribute in XPath expessions.
Customizations
Change the default Appium server address if needed inside inspector.js file, APPIUM_ROOT constant.
Option 2:
System.out.println(driver.getPageSource()); - By this you can get the page source and you can extract the xpath using XML