Xcode build fails for ios 17.6
Solved
Mobile and Embedded
-
I have connected my ios 17.6 to my laptop and tried to build my qt app thinking it would work as well as with the simulator but the xcode build fails.
The documentation saysFor iOS devices with iOS 16 or earlier, Qt Creator also supports accessing the application output, debugging, and profiling. However, these features are not supported for physical devices with iOS 17 or later because of limitations of the Apple tool for accessing these devices. You can build applications for the latest iOS version and deploy them to previous versions. For the most part, this works automatically. However, you must take care when you manually set your own target version. If you set it to a value higher than what Qt requires and supply your own Info.plist file, you must add an LSMinimumSystemVersion entry to the Info.plist that matches the value of CMAKE_OSX_DEPLOYMENT_TARGET (when using CMake), QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake), or cpp.minimumIosVersion (when using Qbs) because iOS (and the App Store) will use the LSMinimumSystemVersion value as the authoritative one.
I tried to do that in my cmake file but failed
cmake_minimum_required(VERSION 3.16) project(Finbank VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_OSX_SYSROOT iphoneos) # Use `iphonesimulator` for the simulator set(CMAKE_OSX_ARCHITECTURES arm64) # iOS devices typically require arm64 architecture set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE YES) set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0") # Adjust the version based on your requirements find_package(Qt6 6.5 REQUIRED COMPONENTS Quick Multimedia NetworkAuth Sql Charts) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appFinbank src/main.cpp src/register.hpp src/register.cpp src/databasemanager.hpp src/databasemanager.cpp src/login.hpp src/login.cpp src/googlegateway.hpp src/googlegateway.cpp src/dashboard.hpp src/dashboard.cpp src/searchrecipent.hpp src/searchrecipent.cpp src/createtransaction.hpp src/createtransaction.cpp src/stockapiclient.hpp src/stockapiclient.cpp ) qt_add_qml_module(appFinbank URI Finbank VERSION 1.0 QML_FILES qml/LandingPage.qml qml/SignUp.qml qml/SignInWindow.ui.qml qml/TradingDashboard.qml qml/Stock.qml qml/TransactionsWindow.ui.qml qml/DashboardWindow.ui.qml qml/SendMoneyWindow.ui.qml qml/SelectRecipent.qml qml/RecipentDescription.qml qml/SignUpWindow_1.ui.qml qml/RecipentDescriptionWindow.ui.qml qml/TransferType.qml qml/SignIn.qml qml/Currencies.qml qml/TradingMarket.qml qml/SelectRecipentWindow.ui.qml qml/TradingMarketWindow.ui.qml qml/OverviewTransactionWindow.ui.qml qml/CurrenciesWindow.ui.qml qml/FoundUser.qml qml/Dashboard.qml qml/Transactions.qml qml/SingleTransactionDetail.qml qml/TransactionDetailsWindows.ui.qml qml/SendMoney.qml qml/SignUpWindow.ui.qml qml/LogInWindow.ui.qml qml/SelectedRecipent.qml qml/TradingDashboardWindow.ui.qml qml/OverviewTransaction.qml qml/SignUp1.qml qml/TransferTypeWindow.ui.qml RESOURCES resources/resources.qrc ) qt_add_ios_ffmpeg_libraries(appFinbank) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appFinbank PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appFinbank MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appFinbank PRIVATE Qt6::Quick Qt6::Multimedia Qt6::NetworkAuth Qt6::Sql Qt6::Charts ) include(GNUInstallDirs) install(TARGETS appFinbank BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
-
I got a strange popup when I commented
set(CMAKE_OSX_ARCHITECTURES arm64) # iOS devices typically require arm64 architecture set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE YES) set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
and I set
set(CMAKE_OSX_SYSROOT iphoneos) # Use `iphonesimulator` for the simulator
I got popup saying
codesign wants to access key "Apple Development: Boyan Kyovtorov (Boyan Kyovtorov)" in your keychain
Where i enter my macbook password 3 times with "Always allow" and it built. But I don't see an app on my Iphone -