16

デバイスにインストールされているアプリのバンドル ID のリストがあり、アプリ名を取得したいと考えています。ソリューションは、jail で壊れていないデバイスで動作するはずです。アプリはアプリ ストアに掲載されないため、アプリの拒否は成立しません。


アプリストアにある場合、アプリの詳細情報を返すこのソリューションを見つけました。 http://itunes.apple.com/lookup?bundleId=com.bundle.id

4

7 に答える 7

28

ほとんどの場合、これで取得できます...

NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleNameKey];

編集:

すべてのアプリで検索したいAS。

NSString *appName = [[NSBundle bundleWithIdentifier:@"BundleIdentifier"] objectForInfoDictionaryKey:(id)kCFBundleExecutableKey];
NSLog(@"AppName: %@",appName);
于 2012-12-24T16:34:27.953 に答える
11

これでうまくいくはずです。

NSBundle *bundle = [NSBundle bundleWithIdentifier:@"yourBundleIdentifier"];
NSString *appName = [bundle objectForInfoDictionaryKey:@"CFBundleExecutable"];

方法

- (NSString *)titleOfAppWithBundleIdentifier:(NSString *)bundleIdentifier {
    NSBundle *bundle = [NSBundle bundleWithIdentifier:bundleIdentifier];
    return [bundle objectForInfoDictionaryKey:@"CFBundleExecutable"];
}
于 2012-12-24T16:31:46.667 に答える
9

バンドル ディクショナリを次のように設定します。

NSDictionary *bundleInfo = [[NSBundle mainBundle] infoDictionary];

NSString *appName = [bundleInfo objectForKey:@"CFBundleDisplayName"];

そして、ここにbundleInfoダンプされます:

{
    BuildMachineOSBuild = ...;
    CFBundleDevelopmentRegion = ...;
    CFBundleDisplayName = ...;
    CFBundleExecutable = ...;
    CFBundleIcons = {
        CFBundlePrimaryIcon = {
        CFBundleIconFiles = (
            "AppIcon29x29.png",
            "AppIcon29x29@2x.png",
            "AppIcon40x40@2x.png",
            "AppIcon57x57.png",
            "AppIcon57x57@2x.png",
            "AppIcon60x60@2x.png",
            "AppIcon60x60@3x.png"
        );
        UIPrerenderedIcon = 1;
       };
    };
    CFBundleIdentifier = ...;
    CFBundleInfoDictionaryVersion = ...;
    CFBundleInfoPlistURL = ...;
    CFBundleName = ...;
    CFBundleNumericVersion = 0;
    CFBundlePackageType = APPL;
    CFBundleShortVersionString = ...;
    CFBundleSignature = "????";
    CFBundleSupportedPlatforms =     (
        iPhoneOS
    );
    CFBundleVersion = "1.0.11";
    DTCompiler = ...;
    DTPlatformBuild = ...;
    DTPlatformName = iphoneos;
    DTPlatformVersion = "8.3";
    DTSDKBuild = ...;
    DTSDKName = "iphoneos8.3";
    DTXcode = ...;
    DTXcodeBuild = ...;
    LSRequiresIPhoneOS = 1;
    MinimumOSVersion = "5.1";
    UIBackgroundModes =     (
        ...,
        ...
    );
    UIDeviceFamily =     (
        1
    );
    UILaunchImageFile = LaunchImage;
    UILaunchImages =     (
            {
            UILaunchImageMinimumOSVersion = "7.0";
            UILaunchImageName = ...;
            UILaunchImageOrientation = Portrait;
            UILaunchImageSize = "{320, 568}";
        }
    );
    UIMainStoryboardFile = Main;
    UIRequiredDeviceCapabilities =     (
        armv7
    );
    UISupportedInterfaceOrientations =     (
        UIInterfaceOrientationPortrait
    );
    UIViewControllerBasedStatusBarAppearance = 0;
}
于 2015-06-11T06:35:01.277 に答える
2

ローカライズされたバンドルの表示名を取得する場合は、次を使用しますlocalizedInfoDictionary

NSString *appName = [[NSBundle mainBundle] localizedInfoDictionary][@"CFBundleDisplayName"];
于 2014-02-26T10:23:18.880 に答える
-3
NSString *appName = [[bundleID componentsSeparatedByString:@"."] lastObject];

bundleID がリバース DNS 形式であると仮定します。

于 2012-12-24T16:24:19.077 に答える