Created
July 22, 2016 19:24
-
-
Save caoer/06a32c24c0e8f59fac009a3005ec6c79 to your computer and use it in GitHub Desktop.
find all installed apps
This file contains hidden or 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
Class c = NSClassFromString(@"LSApplicationWorkspace"); | |
id s = [(id) c performSelector:NSSelectorFromString(@"defaultWorkspace")]; | |
NSArray *arr = [s performSelector:NSSelectorFromString(@"allInstalledApplications")]; | |
for (id item in arr) { | |
NSLog(@"appId:%@", [item performSelector:NSSelectorFromString(@"applicationIdentifier")]); | |
NSLog(@"bundleVer:%@", [item performSelector:NSSelectorFromString(@"bundleVersion")]); | |
NSLog(@"shortVer:%@", [item performSelector:NSSelectorFromString(@"shortVersionString")]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment