How to quickly get app's directory from its bundle id on jailbroken iOS device?

岁酱吖の 提交于 2019-12-03 03:44:40

I think the file you are looking for is

/var/mobile/Library/Caches/com.apple.mobile.installation.plist

For example, it contains information like this for each app:

    "com.zillow.ZillowMap" =         {
        ApplicationDSID = 216284405;
        ApplicationType = User;
        CFBundleDisplayName = Zillow;
        CFBundleExecutable = ZillowMap;
        CFBundleIconFiles =             (
            "app-icon",
            "app-icon-iPad.png",
            "app-icon-iPad@2x.png"
        );
        CFBundleIcons =             {
            CFBundlePrimaryIcon =                 {
                CFBundleIconFiles =                     (
                    "app-icon",
                    "app-icon-iPad.png",
                    "app-icon-iPad@2x.png"
                );
                UIPrerenderedIcon = 1;
            };
        };
        CFBundleIdentifier = "com.zillow.ZillowMap";
        CFBundleName = ZillowMap;
        CFBundleShortVersionString = "6.1.0112";
        CFBundleVersion = "6.1.0112";
        CodeInfoIdentifier = "com.zillow.ZillowMap";
        Container = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
        Entitlements =             {
            "application-identifier" = "JEWMY3RZ4A.com.zillow.ZillowMap";
            "aps-environment" = production;
        };
        EnvironmentVariables =             {
            "CFFIXED_USER_HOME" = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
            HOME = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
            TMPDIR = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D/tmp";
        };
        IsUpgradeable = 1;
        LSRequiresIPhoneOS = 1;
        MinimumOSVersion = "5.0";
        Path = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D/ZillowMap.app";
        SequenceNumber = 2618;
        SignerIdentity = "Apple iPhone OS Application Signing";
        UIDeviceFamily =             (
            1,
            2
        );
        UIPrerenderedIcon = 1;
    };

Update

This file was removed in iOS 8: (https://www.theiphonewiki.com/wiki/Com.apple.mobile.installation.plist)

There exists a similar file for iOS 8 at /var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist, but it might only be updated at launch (reboot).

And here this is another solution, if your code runs in SpringBoard:

NSString *applicationBundleIdentifier = @"...";
SBApplication *application = [[SBApplicationController sharedInstance]applicationWithDisplayIdentifier:applicationBundleIdentifier];
NSString *path = application.containerPath;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!