Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to compile an iOS application in Qt?
QtWS25 Last Chance

How to compile an iOS application in Qt?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
64 Posts 11 Posters 18.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Freder89
    wrote on last edited by Freder89
    #3

    This shows how to compile qt5 for the iOS simulator.

    Based on qt build instructions for iOS. TellPopeyes

    J.HilkJ 1 Reply Last reply
    0
    • F Freder89

      This shows how to compile qt5 for the iOS simulator.

      Based on qt build instructions for iOS. TellPopeyes

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #4

      @Freder89 said in How to compile an iOS application in Qt?:

      This shows how to compile qt5 for the iOS simulator.

      Based on qt build instructions for iOS.

      It does not.

      I linked to start page of the documentation for Qt on iOS

      Your link is broken btw, as the snapshot page is no longer valid.
      The build Qt(for iOS) from sources guide is here:
      https://doc.qt.io/qt-5/ios-building-from-source.html

      and the only differences between iOS devices and iOS simulator is the -sdk argument

      If you do not specify an sdk, then Qt is automatically build for both cases.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mikeeeeee
        wrote on last edited by
        #5

        I compiled a project in MacOS. It works on MacOS. Will it work in iOS? Or do I need to somehow collect the project?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #6

          Hi,

          You will have to build it for iOS. macOS and iOS are two different platforms currently.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M Offline
            M Offline
            Mikeeeeee
            wrote on last edited by
            #7

            How to compile an application on iOS?
            I have Xcode and a project in MacOS.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8

              As @J-Hilk already pointed you to: The Getting Started Guide for iOS in Qt's documentation.

              The very short way:

              1. Open the project with Qt Creator
              2. Select the iOS Kit
              3. Build your application as usual

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Mikeeeeee
                wrote on last edited by
                #9

                I did not understand where to choose the iOS kit?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  Did you select Qt for iOS when you installed Qt on your machine ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mikeeeeee
                    wrote on last edited by
                    #11

                    I dont know. I installed Qt for MacOS. How to check it? If everything is fine, then what to do next?

                    V 1 Reply Last reply
                    0
                    • M Mikeeeeee

                      I dont know. I installed Qt for MacOS. How to check it? If everything is fine, then what to do next?

                      V Offline
                      V Offline
                      vladstelmahovsky
                      wrote on last edited by
                      #12

                      @Mikeeeeee run Qt Maintenance tool and check if Qt for iOS is installed

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        Mikeeeeee
                        wrote on last edited by
                        #13

                        Qt for iOS is installed

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          Laszlo LG
                          wrote on last edited by Laszlo LG
                          #14

                          You cross compile on the MacOS for the iOS.

                          1. connect your iOS device with USB cable to the MacOS
                          2. let Xcode to recognise it, start with an Xcode example and run on your iOS device
                          3. in QtCreator click to Projects then ensure that Qt .... for iOS2 kit is available
                          4. in QtCreator choose the "Qt .... for iOS2 kit" target by clicking to the icon above the green triangle
                          5. 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.

                          1 Reply Last reply
                          1
                          • M Offline
                            M Offline
                            Mikeeeeee
                            wrote on last edited by
                            #15

                            Projects has only Desktop Clang 64 bit

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              Mikeeeeee
                              wrote on last edited by
                              #16

                              Can I build without an iOS device?

                              L 1 Reply Last reply
                              0
                              • M Mikeeeeee

                                Can I build without an iOS device?

                                L Offline
                                L Offline
                                Laszlo LG
                                wrote on last edited by
                                #17

                                Yes, build should work without running on the device after selecting the kit as SGaist wrote. In the QtCreator's Projects view on the top there is a button "Manage Kits..." , use this to add one for iOS.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  Mikeeeeee
                                  wrote on last edited by
                                  #18

                                  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?

                                  L 1 Reply Last reply
                                  0
                                  • M Mikeeeeee

                                    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?

                                    L Offline
                                    L Offline
                                    Laszlo LG
                                    wrote on last edited by Laszlo LG
                                    #19

                                    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.sdk

                                    Then 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.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      Mikeeeeee
                                      wrote on last edited by
                                      #20

                                      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?
                                      0_1558354976077_1.png

                                      L 1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #21

                                        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 ?

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • M Mikeeeeee

                                          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?
                                          0_1558354976077_1.png

                                          L Offline
                                          L Offline
                                          Laszlo LG
                                          wrote on last edited by
                                          #22

                                          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.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved