Skip to content

Instantly share code, notes, and snippets.

@triangletodd
Last active December 12, 2020 22:44
Show Gist options
  • Save triangletodd/0083d2892f16584dd487 to your computer and use it in GitHub Desktop.
Save triangletodd/0083d2892f16584dd487 to your computer and use it in GitHub Desktop.
IOS UIAutomation Debugging
function dumpElementTree() {
UIALogger.logStart("Logging element tree ...");
UIATarget.localTarget().logElementTree();
UIALogger.logPass();
}
function inspect(obj) {
var log = UIALogger;
var methods = [];
log.logStart("Logging methods for object...")
for (var m in obj) {
if (typeof obj[m] == "function") {
log.logDebug(m);
}
}
log.logPass();
}
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
var navbar = app.navigationBar();
inspect(navbar);
dumpElementTree();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment