iOS获取手机上app信息
在代码中插入一段查询网址即可获取app信息以及版本信息。
查询命令:http://itunes.apple.com/lookup?id=xxxxxxxxx(9位appid数字)
获取设备上所有app (为LSApplicationProxy 对象)
-
Class LSApplicationWorkspace_class = objc_getClass(“LSApplicationWorkspace”);
-
NSObject *workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
-
NSArray *apps = [workspace performSelector:@selector(allInstalledApplications)];
-
NSLog(@”apps: %@”, apps);
获取版本信息
[apps[0] performSelector:NSSelectorFromString(@"shortVersionString")]
其他
1 | /* Generated by RuntimeBrowser |
2 | Image: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices |
3 | */ |
4 | |
5 | @interface LSApplicationProxy : LSBundleProxy <NSSecureCoding> { |
6 | NSNumber *_ODRDiskUsage; |
7 | NSArray *_UIBackgroundModes; |
8 | NSArray *_*Plugins; |
9 | NSArray *_appTags; |
10 | NSString *_applicationDSID; |
11 | NSString *_applicationVariant; |
12 | NSArray *_audioComponents; |
13 | NSString *_companionAppIdentifier; |
14 | NSArray *_deviceFamily; |
15 | NSUUID *_deviceIdentifierForVendor; |
16 | NSArray *_directionsModes; |
17 | NSNumber *_downloaderDSID; |
18 | NSNumber *_dynamicDiskUsage; |
19 | NSArray *_externalAccessoryProtocols; |
20 | NSNumber *_familyID; |
21 | unsigned int _flags; |
22 | NSDictionary *_groupContainers; |
23 | NSArray *_groupIdentifiers; |
24 | unsigned int _installType; |
25 | NSNumber *_itemID; |
26 | NSString *_itemName; |
27 | NSString *_minimumSystemVersion; |
28 | long _modTime; |
29 | unsigned int _originalInstallType; |
30 | NSArray *_plugInKitPlugins; |
31 | NSArray *_pluginUUIDs; |
32 | NSArray *_privateDocumentIconNames; |
33 | LSApplicationProxy *_privateDocumentTypeOwner; |
34 | NSNumber *_purchaserDSID; |
35 | long _regTime; |
36 | NSDate *_registeredDate; |
37 | NSArray *_requiredDeviceCapabilities; |
38 | NSString *_sdkVersion; |
39 | NSString *_shortVersionString; |
40 | NSString *_sourceAppIdentifier; |
41 | NSNumber *_staticDiskUsage; |
42 | NSString *_storeCohortMetadata; |
43 | NSNumber *_storeFront; |
44 | NSString *_teamID; |
45 | NSString *_vendorName; |
46 | NSNumber *_versionID; |
47 | } |
48 | |
49 | @property (nonatomic, readonly) NSNumber *ODRDiskUsage; |
50 | @property (nonatomic, readonly) NSArray *UIBackgroundModes; |
51 | @property (nonatomic, readonly) NSArray **Plugins; |
52 | @property (nonatomic, readonly) NSArray *appTags; |
53 | @property (nonatomic, readonly) NSString *applicationDSID; |
54 | @property (nonatomic, readonly) NSString *applicationIdentifier; |
55 | @property (nonatomic, readonly) NSString *applicationType; |
56 | @property (nonatomic, readonly) NSString *applicationVariant; |
57 | @property (nonatomic, readonly) NSArray *audioComponents; |
58 | @property (nonatomic, readonly) NSNumber *betaExternalVersionIdentifier; |
59 | @property (nonatomic, readonly) NSString *companionApplicationIdentifier; |
60 | @property (nonatomic, readonly) NSArray *deviceFamily; |
61 | @property (nonatomic, readonly) NSUUID *deviceIdentifierForVendor; |
62 | @property (nonatomic, readonly) NSArray *directionsModes; |
63 | @property (nonatomic, readonly) NSNumber *downloaderDSID; |
64 | @property (nonatomic, readonly) NSNumber *dynamicDiskUsage; |
65 | @property (nonatomic, readonly) NSArray *externalAccessoryProtocols; |
66 | @property (nonatomic, readonly) NSNumber *externalVersionIdentifier; |
67 | @property (nonatomic, readonly) NSNumber *familyID; |
68 | @property (nonatomic, readonly) BOOL fileSharingEnabled; |
69 | @property (nonatomic, readonly) NSDictionary *groupContainers; |
70 | @property (nonatomic, readonly) NSArray *groupIdentifiers; |
71 | @property (nonatomic, readonly) BOOL hasMIDBasedSINF; |
72 | @property (nonatomic, readonly) BOOL hasSettingsBundle; |
73 | @property (nonatomic, readonly) BOOL iconIsPrerendered; |
74 | @property (nonatomic, readonly) NSProgress *installProgress; |
75 | @property (nonatomic, readonly) unsigned int installType; |
76 | @property (nonatomic, readonly) BOOL isAdHocCodeSigned; |
77 | @property (nonatomic, readonly) BOOL isAppUpdate; |
78 | @property (nonatomic, readonly) BOOL isBetaApp; |
79 | @property (nonatomic, readonly) BOOL isInstalled; |
80 | @property (nonatomic, readonly) BOOL isNewsstandApp; |
81 | @property (nonatomic, readonly) BOOL isPlaceholder; |
82 | @property (nonatomic, readonly) BOOL isPurchasedReDownload; |
83 | @property (nonatomic, readonly) BOOL isRestricted; |
84 | @property (nonatomic, readonly) BOOL isWatchKitApp; |
85 | @property (nonatomic, readonly) NSNumber *itemID; |
86 | @property (nonatomic, readonly) NSString *itemName; |
87 | @property (nonatomic, readonly) NSString *minimumSystemVersion; |
88 | @property (nonatomic, readonly) BOOL missingRequiredSINF; |
89 | @property (nonatomic, readonly) unsigned int originalInstallType; |
90 | @property (nonatomic, readonly) NSArray *plugInKitPlugins; |
91 | @property (nonatomic, readonly) NSString *preferredArchitecture; |
92 | @property (nonatomic, readonly) BOOL profileValidated; |
93 | @property (nonatomic, readonly) NSNumber *purchaserDSID; |
94 | @property (nonatomic, readonly) NSDate *registeredDate; |
95 | @property (getter=isRemoveableSystemApp, nonatomic, readonly) BOOL removeableSystemApp; |
96 | @property (getter=isRemovedSystemApp, nonatomic, readonly) BOOL removedSystemApp; |
97 | @property (nonatomic, readonly) NSArray *requiredDeviceCapabilities; |
98 | @property (nonatomic, readonly) NSString *roleIdentifier; |
99 | @property (nonatomic, readonly) NSString *sdkVersion; |
100 | @property (nonatomic, readonly) NSString *shortVersionString; |
101 | @property (nonatomic, readonly) NSString *sourceAppIdentifier; |
102 | @property (nonatomic, readonly) NSNumber *staticDiskUsage; |
103 | @property (nonatomic, readonly) NSString *storeCohortMetadata; |
104 | @property (nonatomic, readonly) NSNumber *storeFront; |
105 | @property (nonatomic, readonly) BOOL supportsAudiobooks; |
106 | @property (nonatomic, readonly) BOOL supportsExternallyPlayableContent; |
107 | @property (nonatomic, readonly) BOOL supportsOpenInPlace; |
108 | @property (nonatomic, readonly) BOOL supportsPurgeableLocalStorage; |
109 | @property (nonatomic, readonly) NSString *teamID; |
110 | @property (nonatomic, readonly) NSString *vendorName; |
111 | @property (getter=isWhitelisted, nonatomic, readonly) BOOL whitelisted; |
112 | |
113 | // Image: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices |
114 | |
115 | + (id)applicationProxyForBundleURL:(id)arg1; |
116 | + (id)applicationProxyForCompanionIdentifier:(id)arg1; |
117 | + (id)applicationProxyForIdentifier:(id)arg1; |
118 | + (id)applicationProxyForIdentifier:(id)arg1 placeholder:(BOOL)arg2; |
119 | + (id)applicationProxyForIdentifier:(id)arg1 roleIdentifier:(id)arg2; |
120 | + (id)applicationProxyForItemID:(id)arg1; |
121 | + (id)applicationProxyWithBundleUnitID:(unsigned long)arg1; |
122 | + (BOOL)supportsSecureCoding; |
123 | |
124 | – (id)ODRDiskUsage; |
125 | – (id)UIBackgroundModes; |
126 | – (id)*Plugins; |
127 | – (id)_initWithBundleUnit:(unsigned long)arg1 applicationIdentifier:(id)arg2; |
128 | – (id)appStoreReceiptURL; |
129 | – (id)appTags; |
130 | – (id)applicationDSID; |
131 | – (id)applicationIdentifier; |
132 | – (id)applicationType; |
133 | – (id)applicationVariant; |
134 | – (id)audioComponents; |
135 | – (id)betaExternalVersionIdentifier; |
136 | – (long)bundleModTime; |
137 | – (id)companionApplicationIdentifier; |
138 | – (void)dealloc; |
139 | – (id)description; |
140 | – (id)deviceFamily; |
141 | – (id)deviceIdentifierForVendor; |
142 | – (id)directionsModes; |
143 | – (id)downloaderDSID; |
144 | – (id)dynamicDiskUsage; |
145 | – (void)encodeWithCoder:(id)arg1; |
146 | – (id)externalAccessoryProtocols; |
147 | – (id)externalVersionIdentifier; |
148 | – (id)familyID; |
149 | – (BOOL)fileSharingEnabled; |
150 | – (id)groupContainers; |
151 | – (id)groupIdentifiers; |
152 | – (BOOL)hasMIDBasedSINF; |
153 | – (BOOL)hasSettingsBundle; |
154 | – (unsigned int)hash; |
155 | – (id)iconDataForVariant:(int)arg1; |
156 | – (BOOL)iconIsPrerendered; |
157 | – (id)iconStyleDomain; |
158 | – (id)initWithCoder:(id)arg1; |
159 | – (id)installProgress; |
160 | – (id)installProgressSync; |
161 | – (unsigned int)installType; |
162 | – (BOOL)isAdHocCodeSigned; |
163 | – (BOOL)isAppUpdate; |
164 | – (BOOL)isBetaApp; |
165 | – (BOOL)isEqual:(id)arg1; |
166 | – (BOOL)isInstalled; |
167 | – (BOOL)isNewsstandApp; |
168 | – (BOOL)isPlaceholder; |
169 | – (BOOL)isPurchasedReDownload; |
170 | – (BOOL)isRemoveableSystemApp; |
171 | – (BOOL)isRemovedSystemApp; |
172 | – (BOOL)isRestricted; |
173 | – (BOOL)isSystemOrInternalApp; |
174 | – (BOOL)isWatchKitApp; |
175 | – (BOOL)isWhitelisted; |
176 | – (id)itemID; |
177 | – (id)itemName; |
178 | – (id)localizedName; |
179 | – (id)localizedNameForContext:(id)arg1; |
180 | – (id)localizedShortName; |
181 | – (id)machOUUIDs; |
182 | – (id)minimumSystemVersion; |
183 | – (BOOL)missingRequiredSINF; |
184 | – (unsigned int)originalInstallType; |
185 | – (id)plugInKitPlugins; |
186 | – (void)populateNotificationData; |
187 | – (id)preferredArchitecture; |
188 | – (BOOL)privateDocumentIconAllowOverride; |
189 | – (id)privateDocumentIconNames; |
190 | – (id)privateDocumentTypeOwner; |
191 | – (id)privateIconsDictionary; |
192 | – (BOOL)profileValidated; |
193 | – (id)purchaserDSID; |
194 | – (id)registeredDate; |
195 | – (id)requiredDeviceCapabilities; |
196 | – (id)resourcesDirectoryURL; |
197 | – (id)roleIdentifier; |
198 | – (id)sdkVersion; |
199 | – (void)setPrivateDocumentIconAllowOverride:(BOOL)arg1; |
200 | – (void)setPrivateDocumentIconNames:(id)arg1; |
201 | – (void)setPrivateDocumentTypeOwner:(id)arg1; |
202 | – (id)shortVersionString; |
203 | – (id)sourceAppIdentifier; |
204 | – (id)staticDiskUsage; |
205 | – (id)storeCohortMetadata; |
206 | – (id)storeFront; |
207 | – (BOOL)supportsAudiobooks; |
208 | – (BOOL)supportsExternallyPlayableContent; |
209 | – (BOOL)supportsOpenInPlace; |
210 | – (BOOL)supportsPurgeableLocalStorage; |
211 | – (id)teamID; |
212 | – (id)uniqueIdentifier; |
213 | – (id)userActivityStringForAdvertisementData:(id)arg1; |
214 | – (id)vendorName; |
215 | – (id)versionIdentifier; |
216 | |
217 | // Image: /System/Library/Frameworks/UIKit.framework/UIKit |
218 | |
219 | – (struct CGSize { float x1; float x2; })_defaultStyleSize:(id)arg1; |
220 | – (struct { int x1; struct CGSize { float x_2_1_1; float x_2_1_2; } x2; }*)_iconVariantDefinitions:(id)arg1; |
221 | |
222 | // Image: /System/Library/PrivateFrameworks/UserNotification.framework/UserNotification |
223 | |
224 | + (id)un_bundleForBundleIdentifier:(id)arg1; |
225 | |
226 | – (id)_un_bundle; |
227 | – (BOOL)_un_isReallyInstalled; |
228 | – (BOOL)_un_isResourceValidForPath:(id)arg1 withContainerPath:(id)arg2; |
229 | – (BOOL)_un_usesLocalNotification; |
230 | – (id)un_infoDictionary; |
231 | – (BOOL)un_isSystemApplication; |
232 | – (id)un_pathForSoundName:(id)arg1; |
233 | – (BOOL)un_requiresLocalNotification; |
234 | – (BOOL)un_shouldUseDefaultDataProvider; |
235 | |
236 | @end |