plist实用程序转换信息。plist在iphone应用程序

时间:2023-02-05 14:06:26

I try to build an iPhone app with command line.

我尝试用命令行构建一个iPhone应用程序。

I have a problem on Info.plist file.

我在信息方面有问题。plist文件。

XCode converts a XML file MyApp-Info.plist to a binary file Info.plist, like this :

XCode转换XML文件MyApp-Info。plist到二进制文件信息。plist,像这样:

builtin-infoPlistUtility MyApp-Info.plist -genpkginfo <path>/MyApp.app/PkgInfo -expandbuildsettings -format binary -platform iphoneos -resourcerulesfile <path>/MyApp.app/ResourceRules.plist -o <path>/MyApp.app/Info.plist

Today, I compile Info.plist with XCode and then I can sign MyApp.app with codesign successfully.

今天,我编译信息。plist和XCode,然后我可以在MyApp上签名。成功应用与合作设计。

I try to compile Info.plist with plutil tool, like this :

我试着编译信息。plist使用plutil工具,如下:

plutil -convert binary1 <path>/MyApp.app/Info.plist

It works, but then codesign failed with error :

它是有效的,但是codesign失败了:

object file format invalid or unsuitable

I think I need other options for plutil utility but I don't know which ones.

我想我需要其他的plutil实用工具,但我不知道是哪一个。

Any help please ?

任何帮助吗?

1 个解决方案

#1


2  

Im quite sure that the Info.plist file does not need to be in binary format to work. Does work if you just leave it as standard XML file?

我很确定这个信息。plist文件不需要二进制格式才能工作。如果您只是将它作为标准XML文件保留,它是否有效?

I have seen this error message when the CFBundleResourceSpecification key was missing, should probably have the value ResourceRules.plist. It also seams to happen if the CFBundleExecutable key is missing.

当cfbundleresourcspecification键丢失时,我看到了这个错误消息,可能应该有value resources .plist。如果cfbundle可执行密钥丢失,也会发生这种情况。

A good way to see which keys that are used in a resulting app bundle is to do this:

查看结果应用程序包中使用的键的一个好方法是:

  1. Create a new fresh iOS app in Xcode
  2. 在Xcode中创建一个新的iOS应用
  3. Configure minimum version, platform, orientations etc.
  4. 配置最小版本、平台、方向等。
  5. Build the app
  6. 构建应用程序
  7. Expand the "Product" group in the project tree and choose "Show in finder" on the app
  8. 展开项目树中的“Product”组,在app上选择“Show in finder”
  9. Choose "Show Package Contents" on the app bundle
  10. 在应用程序包中选择“显示包内容”。
  11. Open the Info.plist file and inspect it
  12. 打开信息。列出文件并检查

Use plutil if you want to convert to resulting binary plist to XML format.

如果您想要将生成的二进制plist转换为XML格式,请使用plutil。

#1


2  

Im quite sure that the Info.plist file does not need to be in binary format to work. Does work if you just leave it as standard XML file?

我很确定这个信息。plist文件不需要二进制格式才能工作。如果您只是将它作为标准XML文件保留,它是否有效?

I have seen this error message when the CFBundleResourceSpecification key was missing, should probably have the value ResourceRules.plist. It also seams to happen if the CFBundleExecutable key is missing.

当cfbundleresourcspecification键丢失时,我看到了这个错误消息,可能应该有value resources .plist。如果cfbundle可执行密钥丢失,也会发生这种情况。

A good way to see which keys that are used in a resulting app bundle is to do this:

查看结果应用程序包中使用的键的一个好方法是:

  1. Create a new fresh iOS app in Xcode
  2. 在Xcode中创建一个新的iOS应用
  3. Configure minimum version, platform, orientations etc.
  4. 配置最小版本、平台、方向等。
  5. Build the app
  6. 构建应用程序
  7. Expand the "Product" group in the project tree and choose "Show in finder" on the app
  8. 展开项目树中的“Product”组,在app上选择“Show in finder”
  9. Choose "Show Package Contents" on the app bundle
  10. 在应用程序包中选择“显示包内容”。
  11. Open the Info.plist file and inspect it
  12. 打开信息。列出文件并检查

Use plutil if you want to convert to resulting binary plist to XML format.

如果您想要将生成的二进制plist转换为XML格式,请使用plutil。