How to compile an iOS application in Qt?
-
As @J-Hilk already pointed you to: The Getting Started Guide for iOS in Qt's documentation.
The very short way:
- Open the project with Qt Creator
- Select the iOS Kit
- Build your application as usual
-
Did you select Qt for iOS when you installed Qt on your machine ?
-
I dont know. I installed Qt for MacOS. How to check it? If everything is fine, then what to do next?
@Mikeeeeee run Qt Maintenance tool and check if Qt for iOS is installed
-
You cross compile on the MacOS for the iOS.
- connect your iOS device with USB cable to the MacOS
- let Xcode to recognise it, start with an Xcode example and run on your iOS device
- in QtCreator click to Projects then ensure that Qt .... for iOS2 kit is available
- in QtCreator choose the "Qt .... for iOS2 kit" target by clicking to the icon above the green triangle
- in QtCreator click to the run icon (green triangle) to start the application on your mobile device
If QtCreator can't upload the app to the iOS device then from the build folder of QtCreator open the compiled project (folder with .xcodeproj extension) from Xcode and run the app from Xcode.
I hope it helps, ask if anything needs clarification.
Distribution of the app to the appStore is a different story. -
I tried setting up a new set for iOS. Got an error : Could not resolve SDK Path for "iphone os" using --show-sdk-path. How to configure the compilation set correctly?
When I open the "Manage Kits..." window it shows several sub menus starting with Kits, Environments,.....
The Devices tab allows to set the Android SDK and it has a download link as well. I think the iOS build on macOS does not need the Android SDK so I guess if you stay on the Kits tab and add a new kit then the Sysroot setting contains the sdk. For me it is set to:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdkThen in the projects configurator click to the newly created kit to add it to your project. Then Build / "Open Build and Run Kit selector" menu should offer it as a target.
-
If you used the online installer to install both versions of Qt, then Qt Creator should already be configured for all the Qt versions you installed.
Wasn't that the case ?
-
I do not understand.
Am I using the right compiler?
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" is the path to the debugger?
plug your iOS device first then click to manage kits
устройство: select the plugged in device
The next field is the sysroot.The compiler should fit to your device, for me it is Apple Clang (arm64).
Again as SGaist suggested, the easiest config happens with update/install. From QtCreator you can use the QtCreator/"Check for updates" menu then select the first option from (Add or update components, Update components, Remove all components) and ensure that under the tree of Qt version the iOS is selected. You already confirmed its installation so in the kit selection you should not add a new one, just select the qt version for iOS "Qt 5.12.2 for iOS2".
Using QtCreator's "Projects" icon you should see all the available kits with light grey colour. Click to the name of the kit "Qt 5.12.2 for iOS2" to associate with your project then select as build target. -
I don't have an Apple Clang compiler. I used the online setup. When installing online, I did not have the configuration automatically. And it seems that some compilers for some reason have not been installed. It seems that I do not have compilers for iOS. How can this be fixed?
-
@Mikeeeeee Can you show the list of your Kits?