Last active
December 26, 2015 09:19
-
-
Save acoomans/7128648 to your computer and use it in GitHub Desktop.
UIAutomation target information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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