qt - QMake:为 iOS App 指定自定义 Info.plist 文件

标签 qt qmake

我有一个使用 Qt(QML) 构建的 iOS 应用程序,我想为其使用自定义 Info.plist 文件。

为此,我像往常一样构建项目(导致 QMake 提供默认的 Info.plist 文件)。然后我转到应用程序包(在 .app 文件内)并将生成的 Info.plist 文件复制到我的源代码树中。复制后,我修改了此文件以进行所需的必要自定义(我只是更改了屏幕方向设置,没有其他任何内容)。

我现在指定这个自定义 Info.plist 的路径以在我的应用程序的 .pro 文件中归档,如下所示:

ios{
    QMAKE_INFO_PLIST = packages/ios/Info.plist
}

当我现在点击构建时,出现以下编译器错误:

Check dependencies
Code Sign error: 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.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.2'

有其他人遇到过这个吗?我正在使用 Qt 5.4.1。在 OSX 上构建。

最佳答案

确保您的 Info.plist 副本是 XML 格式,而不是二进制格式。

这是必要的,因为qmake 使用sed 来替换some variables在构建过程中。例如

 @sed -e "s,@SHORT_VERSION@,1.0,g" -e "s,@FULL_VERSION@,1.0.0,g" -e "s,@TYPEINFO@,????,g" -e "s,@BUNDLEIDENTIFIER@,com.example.product,g" -e "s,@ICON@,myproduct.icns,g" -e "s,@EXECUTABLE@,MyProduct,g" -e "s,@TYPEINFO@,????,g" ../../project/subproject/Info.plist >MyProject.app/Contents/Info.plist

我打开了一个Qt bug因为 qmake 应该检查它。

关于qt - QMake:为 iOS App 指定自定义 Info.plist 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29385950/

相关文章:

qt - 如何通过 Qt 项目文件将命令的输出作为编译器标志传递?

Qt -sysroot、-prefix、-extprefix 和 -hostprefix 选项

c++ - 当我使用 -isystem 标志而不是 INCLUDEPATH 时,QtCreator 的代码检查器中断

macos - qt mac osx 10.8 dyld : library not loaded. ..未找到图像

c++ - 在 QToolBar 中移动 QMenuBar

QTreeView 与 QAbstractItemModel : tree items collapse and expend when adding/updating new children

c++ - 如何设置QTreeWidget表头颜色和隐藏分界线?

qt - 使用 QDataStream 读取文件 : Is it faster with a buffer? 怎么做?

qt - qmake 子目录模板同时运行所有应用程序

c++ - 树莓派的 qmake 条件