8

如发布公告中所述,新的 Qt 5.1 对 iOS 有(部分)支持,但我如何实际构建 Qt 项目并将其部署到 iOS 设备?或者换句话说,我如何最终得到一个 iOS XCode 项目?

4

2 回答 2

9

这显示了如何为 iOS 模拟器编译 qt5。

基于iOS 的 qt 构建说明

如果要为 iOS 设备构建,则必须再次将 qt5 源代码检出到第二个目录并使用备用配置命令,如下所示。

这使用 qt 5.2 beta 1。使用 . 检查更新版本git tag

git clone git://gitorious.org/qt/qt5.git qt5-ios-simulator.git
cd qt5-ios-simulator.git
git tag
git reset --hard v5.2.0-beta1

初始化qt但不要使用webkit,因为编译时间太长

perl init-repository --no-webkit

配置qt使用带模拟器的开源版本,跳过示例和测试

./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests -sdk iphonesimulator

或者,在单独的 git checkout 中使用此配置命令为 iOS 设备构建

./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests

运行制作。并行使用 4 个作业以加快编译速度。

make -j 4
cd ..

完毕。

您可以通过构建示例项目来测试一切是否正常

git clone https://github.com/msorvig/qt-ios-demo.git
cd qt-ios-demo
../qt5-ios-simulator.git/qtbase/bin/qmake 
open qt-ios-demo.xcodeproj
于 2013-10-26T09:19:46.757 回答
3

我自己还没有尝试过,但我想必须在你的 OSX 上安装 XCode 和 Qt Creator。据我所知,Qt 家伙可能喜欢 Android 版本。只需尝试使用在线安装程序安装 Qt SDK 并选择 iOS 版本。其余的应该在 QtCreator 中是可能的。我很想知道它是否有效。

于 2013-07-04T22:01:47.493 回答