Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active December 26, 2015 09:19
Show Gist options
  • Save acoomans/7128648 to your computer and use it in GitHub Desktop.
Save acoomans/7128648 to your computer and use it in GitHub Desktop.
UIAutomation target information
var target = UIATarget.localTarget();
// Bundle ID, ie "com.domain.myapp"
UIALogger.logDebug("bundleID: " + target.frontMostApp().bundleID());
// Name, ie "iPhone Simulator"
UIALogger.logDebug("name : " + target.name());
// Model, ie "iPhone Simulator"
UIALogger.logDebug("model: " + target.model());
// System name, ie "iPhone OS"
UIALogger.logDebug("systemName: " + target.systemName());
// System version, ie "7.0"
UIALogger.logDebug("systemVersion: " + target.systemVersion());
And if you want to test the iOS version, don’t forget it’s a string:
if (target.systemVersion() == "7.0") {
UIALogger.logDebug("Up-to-date!");
} else {
UIALogger.logDebug("Old");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment