简体   繁体   English

如何以编程方式在 iOS 中访问其他已安装应用的 info.plist?

[英]How do I access other installed apps' info.plist in iOS programmatically?

I want to check the versions of other installed apps on my iPad from within my app.我想从我的应用程序中检查 iPad 上其他已安装应用程序的版本。 I know this information is stored in their info.plist files.我知道这些信息存储在他们的 info.plist 文件中。

How can I access the plist of other installed apps programmatically?如何以编程方式访问其他已安装应用程序的 plist? My apps are not published on the app store, so private methods are acceptable.我的应用程序未在应用程序商店上发布,因此可以接受私有方法。

You are right, these values are stored in the Info.plist - more specifically, under the CFBundleShortVersionString and (should you need this too), a build number under the CFBundleVersion key.你是对的,这些值存储在Info.plist - 更具体地说,在CFBundleShortVersionString和(如果你也需要这个)下,在CFBundleVersion键下的内部版本号。

NSBundle has a method called infoDictionary which returns the bundle's Info.plist (your app's if initialized using mainBundle ), so in theory you should be able to load any application bundle this class. NSBundle有一个名为infoDictionary的方法,它返回包的Info.plist (如果使用mainBundle初始化,则您的应用程序的),因此理论上您应该能够加载此类的任何应用程序包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM