Get installed programs on iOS devices

Source: Internet
Author: User

There are three situations:

1. For devices after jailbreak, you can obtain the complete list, which is convenient. The method is as follows:
Http://stackoverflow.com/questions/3878197/is-it-possible-to-get-information-about-all-apps-installed-on-iphone/3878220#3878220

Http://www.iphonedevsdk.com/forum/iphone-sdk-development/22289-possible-retrieve-these-information.html

 

You can also obtain the following code:

Nsfilemanager * filemanager = [nsfilemanager defaultmanager]; nsmutablearray * applist = [[nsmutablearray alloc] init]; nsstring * apppath = @ "/var/mobile/Applications "; for (nsstring * path in [filemanager contentsofdirectoryatpath: apppath error: Nil]) {for (nsstring * subpath in [filemanager contentsofdirectoryatpath: [nsstring stringwithformat: @ "% @/% @", apppath, path] error: Nil]) {If ([subpath hassuffix :@". APP "]) {nsstring * infoplist = [nsstring stringwithformat: @" % @/info. plist ", apppath, path, subpath]; nslog (@" info. plist PATH % @ ", infoplist); nsdictionary * dict = [nsdictionary dictionarywithcontentsoffile: infoplist]; nslog (@" configuration file content of this app % @ ", dict ); [applist addobject: [dict objectforkey: @ "cfbundledisplayname"] ;}} nslog (@ "applist: % @", applist); [applist release];

Directory:/applications/

2. There are no jailbreaking devices and no APIs are provided officially. Therefore, you can only use some tips, but the information is incomplete.
Http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
Http://forrst.com/posts/UIDevice_Category_For_Processes-h1H
Here are two methods:
Method 1: Use URL scheme to check whether the URL scheme exclusive to an application has a response. If there is a response, it indicates that this specific app is installed.
Method 2: Use some methods to obtain information about the currently running process, and obtain information about the installed app from the process information.

Another method that should be feasible is to determine whether or not some software is installed. For this method, refer to this article:

Http://www.iloss.me /? P = 835 but in general, it is not easy to obtain the complete installation list without jailbreak.


3

First, the study in this article must be on the premise of jailbreak.

There are currently three methods to List Installed Software in IOS: (as far as I know)

1. There are two methods for obtaining my previous articles. For more information, see:
Http://www.iloss.me /? P = 844
2. the functions provided by the system should be more convenient, safe, and efficient than the above two methods. (According to my test system, the file com. Apple. Mobile. Installation. plist is also read)
Mobile installation is the IPA framework installed, uninstalled, and updated in IOS.
Obtain the following API

_ Mobileinstallationrebuildmap _ text limit 11ef 00000072 r... B ..
_ Mobileinstallationcheckcapabilitiesmatch _ text 00001261 0000008c r... B ..
_ Mobileinstallationsetdevicecapabilities _ text %12ed 00000089 r... B ..
_ Mobileinstallationcopysafeharbors _ text 00001376 0000007b r... B ..
_ Mobileinstallationremovesafeharbor _ text limit 13f1 00000089 r... B ..
_ Mobileinstallationregistersafeharbor _ text limit 147a limit 00e4 r... B ..
_ Mobileinstallationprocessrestoredcontainer _ text 0000155e 00000087 r... B ..
_ Mobileinstallationlookuparchives _ text limit 15e5 limit 007b r... B ..
_ Mobileinstallationremovearchive _ text 00001660 00000087 r... B ..
_ Mobileinstallationrestore _ text limit 16E7 00000087 r... B ..
_ Mobileinstallationarchive _ text limit 176e 00000087 r... B ..
_ Mobileinstallationbrowse _ text limit 17f5 00000076 r... B ..
_ Mobileinstallationlookup _ text limit 186b 0000007b r... B ..
_ Mobileinstallationuninstall _ text limit 18e6 00000087 r... B ..
_ Mobileinstallationupgrade _ text before 196d 00000087 r... B ..
Here I will only analyze the _ mobileinstallationbrowse

Finally, paste the final analysis result:

INT (* mobileinstallationbrowse) (nsdictionary * options, INT (* callback) (nsdictionary * dict, id value), id value );

Call method:

Static int callback (nsdictionary * dict, Id result) {nsarray * currentlist = [dict objectforkey: @ "currentlist"]; If (currentlist) {for (nsdictionary * appinfo in currentlist) {[(nsmutablearray *) Result addobject: [[appinfo copy] autorelease] ;}} return 0 ;}+ (ID) Browse {nsmutablearray * result = [nsmutablearray new]; mobileinstallationbrowse ([nsdictionary dictionarywithobject: @ "any" forkey: @ "applicationtype"], & callback, result); // any indicates all programs, here we can use "system" and "user" to distinguish between systems and common software}

The final result array will be the list of programs we have obtained. The structure is in plist format, as shown below:

This is the same as the result of the first method.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.