Is it possible to view the UI Hierarchy when running the app through a UI Testing target?
I'm getting a white screen that says "Unable to capture view hierarchy. Check the console log for additional information"
You have an issue because you're trying to Debug View Hierarchy of a wrong process. In UI testing, there are two processes. First is UI Test runner and second is your app. Both are attached but debug view is handling first process by default which is runner not the app. And you can't have view hierarchy for a runner. Thus, this message:
Please note which process is selected.
While the UI test is launched, you can change this selection to the app itself and hit the Debug View Hierarchy button which will successfully capture your app:
This is a little bit tricky though. The runner process is still active and will kill/relaunch your app even if it's in view debug mode. I could capture the hierarchy only while testing single test method. It's likely you will have to put some waiting code to slow down the test execution to actually have time to hit the Debug View Hierarchy button.