Solved How to compile an iOS application in Qt?
-
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.
-
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?
-
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 ?
-
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?
-
I have only these compilers:
-
@Mikeeeeee Can you show the list of your Kits?
-
-
@Mikeeeeee For some reason your iOS Qt Kit wasn't autodetected.
I'm not a Mac expert, but maybe you should try to create and build a default iOS app in XCode to see whether everything needed for iOS apps is installed? -
@Mikeeeeee
you're definitely using the wrong compiler there.
AFAIK, there is no x86 compiler for iOS (accept for the iOS simulator) -
Xcode creates projects and runs them in the simulator. How do I connect Apple Clang compiler and simulator from Xcode?
-
Can you show the compilers and Qt versions tab content.
-
I guess you can do this by selecting the device in Xcode - after connecting with USB. I think you haven't installed the iOS component of Qt properly. You can try to delete/reinstall Qt. Close QtCreator then start Qt/MaintenanceTool.app/Contents/MacOS/MaintenanceTool
Use "Add or remove components" then on the screen where you can select the components to install just ensure that iOS is enabled (and also the Android versions you want to use). -
I installed everything. There is no iOS compiler.
-
Does the compiler for iOS come with Qt or need to be customized?
-
@Mikeeeeee said in How to compile an iOS application in Qt?:
Does the compiler for iOS come with Qt or need to be customized?
No, it comes with XCode from Apple and there is no need to customise it.
-
Looks like the compiler didn't tune in automatically. How to add a new compiler for iOS?
-
@Mikeeeeee Are you sure your XCode is set up properly (meaning support for iOS development installed)?
Do you see "Apple Clang (arm64)" as compiler on the "Compilers" tab? -
I see that. Where is the "Compiler" tab ?
-
@Mikeeeeee I'm talking about Compile tab in QtCreator, not XCode.