修补 Manifest/Plist 以使用不同的平台特定设置进行构建

Patching Manifest/Plist to build with different platform-specific settings

我们正在升级所有三个商店中已发布的本机应用程序,新版本是使用 Visual Studio Tools for Apache Cordova 开发的。

为了能够在商店中升级应用程序,我们需要发布它们并为每个平台指定正确的版本和正确的包 ID。

我们需要编译我们的解决方案指定自定义 manifest/plist 我们将在其中设置正确的版本和包。

VisualStudio Tools for Apache Cordova 具有适用于所有平台的常规设置:

看了available documentation,好像也可以指定平台特定的配置文件:

Android
Place the custom AndroidManifest.xml file in the res/native/android folder to configure settings such as custom intents. Use the generated version of the file in the bld/Debug/platforms/android folder after building a Debug configuration of the project for Android.

iOS
Place a custom Info.plist file in the res/native/ios/config.xml display name folder to override settings like splashscreens or icons. The Info.plist filename must be renamed as follows: config.xml display name-Info.plist. You can find sample versions of these files in the cordova-ios GitHub repository, or you can use the generated version for your app from the build folder on your Mac (when using the remote agent) under the build number/cordovaApp folder.

Windows Phone 8
Place the custom WMAppManifest.xml file in the res/native/wp8/Properties folder. Use the generated version of the file in the bld/Debug/platforms/wp8/Properties folder after building the project for Windows Phone 8.

我们已经开始我们的实验,IOS 尝试添加一个“补丁”XXX-Info.plist,如文档中所述,但我们在编译时遇到此错误:

Automatic provisioning profile selection unavailable: A bundle identifier is required for automatic provisioning profile selection. Either enter a bundle identifier in the Info.plist, or select a provisioning profile to use in the build settings

删除 XXX-Info.plist,解决方案构建没有任何问题。
有什么提示吗?

尝试将以下密钥添加到您的 Info.plist:

<key>CFBundleIdentifier</key>
<string>your.bundle.id.goes.here</string>

此包 ID 应与在 iOS 开发中心生成 iOS 配置文件时使用的包 ID 相匹配。