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. Running a Qt app on iOS device from a Mac M1 / Apple silicon

Running a Qt app on iOS device from a Mac M1 / Apple silicon

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 7 Posters 2.4k 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.
  • H Offline
    H Offline
    Hisni
    wrote on 18 Jan 2021, 00:24 last edited by
    #1

    I just bought a Mac Mini M1, installed XCode and Qt 6.0.1 for iOS. I created an empty Qt Quick project and tried to compile it to my iOS device (which shows up as "Ready to use"). It seems it can not compile out of the box.

    The build output:

    Running /Applications/CMake.app/Contents/bin/cmake -S /Users/johndoe/git/qt6iostest -B /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG in /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG.
    -- The CXX compiler identification is AppleClang 12.0.0.12000032
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - failed
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - broken
    CMake Error at /Applications/CMake.app/Contents/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59 (message):
      The C++ compiler
    
        "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
    
      is not able to compile a simple test program.
    
      It fails with the following output:
    
        Change Dir: /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeTmp
        
        Run Build Command(s):/Users/johndoe/Qt/Tools/Ninja/ninja cmTC_b5e39 && [1/2] Building CXX object CMakeFiles/cmTC_b5e39.dir/testCXXCompiler.cxx.o
        [2/2] Linking CXX executable cmTC_b5e39
        FAILED: cmTC_b5e39 
        : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --target=aarch64-apple-darwin20.1.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_b5e39.dir/testCXXCompiler.cxx.o -o cmTC_b5e39   && :
        ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libc++.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libc++.tbd (4 slices)
        ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libSystem.tbd (4 slices)
        ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        ninja: build stopped: subcommand failed.
    
      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:3 (project)
    
    -- Configuring incomplete, errors occurred!
    See also "/private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeOutput.log".
    See also "/private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeError.log".
    CMake process exited with exit code 1.
    Elapsed time: 00:01.
    

    I'm sure there's an issue due to XCode being installed as a native ARM app and Qt is emulated with Rosetta 2. Has anyone been able to make this compile and run?

    J 1 Reply Last reply 18 Jan 2021, 12:26
    0
    • H Hisni
      18 Jan 2021, 00:24

      I just bought a Mac Mini M1, installed XCode and Qt 6.0.1 for iOS. I created an empty Qt Quick project and tried to compile it to my iOS device (which shows up as "Ready to use"). It seems it can not compile out of the box.

      The build output:

      Running /Applications/CMake.app/Contents/bin/cmake -S /Users/johndoe/git/qt6iostest -B /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG in /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG.
      -- The CXX compiler identification is AppleClang 12.0.0.12000032
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - failed
      -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
      -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - broken
      CMake Error at /Applications/CMake.app/Contents/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake:59 (message):
        The C++ compiler
      
          "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
      
        is not able to compile a simple test program.
      
        It fails with the following output:
      
          Change Dir: /private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeTmp
          
          Run Build Command(s):/Users/johndoe/Qt/Tools/Ninja/ninja cmTC_b5e39 && [1/2] Building CXX object CMakeFiles/cmTC_b5e39.dir/testCXXCompiler.cxx.o
          [2/2] Linking CXX executable cmTC_b5e39
          FAILED: cmTC_b5e39 
          : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --target=aarch64-apple-darwin20.1.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_b5e39.dir/testCXXCompiler.cxx.o -o cmTC_b5e39   && :
          ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libc++.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libc++.tbd (4 slices)
          ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libSystem.tbd, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libSystem.tbd (4 slices)
          ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          ninja: build stopped: subcommand failed.
      
        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:3 (project)
      
      -- Configuring incomplete, errors occurred!
      See also "/private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeOutput.log".
      See also "/private/var/folders/w1/phnpqk3d6tx3dg6x56xrlp1w0000gn/T/QtCreator-zJFCpa/qtc-cmake-ENXAuLvG/CMakeFiles/CMakeError.log".
      CMake process exited with exit code 1.
      Elapsed time: 00:01.
      

      I'm sure there's an issue due to XCode being installed as a native ARM app and Qt is emulated with Rosetta 2. Has anyone been able to make this compile and run?

      J Online
      J Online
      J.Hilk
      Moderators
      wrote on 18 Jan 2021, 12:26 last edited by J.Hilk
      #2

      @Hisni it's not supported yet

      you can follow the progress here:
      https://bugreports.qt.io/browse/QTBUG-85279

      ATA, apparently Qt 6.2


      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.

      S 1 Reply Last reply 18 Jan 2021, 13:56
      1
      • J J.Hilk
        18 Jan 2021, 12:26

        @Hisni it's not supported yet

        you can follow the progress here:
        https://bugreports.qt.io/browse/QTBUG-85279

        ATA, apparently Qt 6.2

        S Offline
        S Offline
        sierdzio
        Moderators
        wrote on 18 Jan 2021, 13:56 last edited by
        #3

        @J-Hilk said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

        @Hisni it's not supported yet

        you can follow the progress here:
        https://bugreports.qt.io/browse/QTBUG-85279

        ATA, apparently Qt 6.2

        No, that's not what OP is asking about. They ask about running iOS from M1 mac.

        Btw. Qt 6.0.0 works on M1, compilation works etc. when you target desktop.

        (Z(:^

        J 1 Reply Last reply 18 Jan 2021, 14:04
        1
        • S sierdzio
          18 Jan 2021, 13:56

          @J-Hilk said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

          @Hisni it's not supported yet

          you can follow the progress here:
          https://bugreports.qt.io/browse/QTBUG-85279

          ATA, apparently Qt 6.2

          No, that's not what OP is asking about. They ask about running iOS from M1 mac.

          Btw. Qt 6.0.0 works on M1, compilation works etc. when you target desktop.

          J Online
          J Online
          J.Hilk
          Moderators
          wrote on 18 Jan 2021, 14:04 last edited by
          #4

          @sierdzio
          fair enough,

          I'm not sure if the precompiled libs for iOS will work then.
          I assume the cross compiler for M1 -> iOS is incompatible with the downloadable libs that were maid with the cross compiler for Intel-> iOS

          right ?


          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.

          S 1 Reply Last reply 18 Jan 2021, 14:07
          0
          • J J.Hilk
            18 Jan 2021, 14:04

            @sierdzio
            fair enough,

            I'm not sure if the precompiled libs for iOS will work then.
            I assume the cross compiler for M1 -> iOS is incompatible with the downloadable libs that were maid with the cross compiler for Intel-> iOS

            right ?

            S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 18 Jan 2021, 14:07 last edited by
            #5

            @J-Hilk said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

            @sierdzio
            fair enough,

            I'm not sure if the precompiled libs for iOS will work then.
            I assume the cross compiler for M1 -> iOS is incompatible with the downloadable libs that were maid with the cross compiler for Intel-> iOS

            right ?

            Possible. I have not tried.

            (Z(:^

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SimonSchroeder
              wrote on 19 Jan 2021, 07:11 last edited by
              #6

              @J-Hilk said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

              I assume the cross compiler for M1 -> iOS is incompatible with the downloadable libs that were maid with the cross compiler for Intel-> iOS

              I don't see a technical reason why this should be. I assume the source for the compiler to be basically the same. Therefore, the output of the compiler should be the same for M1 and Intel.

              However, having a look at the error output: I do see --target=aarch64-apple-darwin20.1.0 in the parameters for clang++ (assuming this means for iOS). At the same time there is also -arch x86_64. All the following errors also indicate that you are compiling an x86 binary. The errors are that the libraries for iOS don't have versions for x86. This is indeed true. It could be that there is a bug here in Qt's cmake configuration.

              I don't have an M1 Mac and I also never compiled for iOS. Maybe someone else can figure it out from here.

              1 Reply Last reply
              2
              • A Offline
                A Offline
                AugustasK
                wrote on 21 May 2021, 11:40 last edited by
                #7

                Any news regarding macOS Big Sur on M1? I still can't seem to build a project for iOS.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  RichardPP
                  wrote on 8 Jan 2022, 05:33 last edited by
                  #8

                  Is there any update for this or does QT just not work with M1 Macs and IOS?

                  S 1 Reply Last reply 10 Jan 2022, 11:32
                  0
                  • R RichardPP
                    8 Jan 2022, 05:33

                    Is there any update for this or does QT just not work with M1 Macs and IOS?

                    S Offline
                    S Offline
                    SimonSchroeder
                    wrote on 10 Jan 2022, 11:32 last edited by
                    #9

                    @RichardPP said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

                    Is there any update for this or does QT just not work with M1 Macs and IOS?

                    Starting with version 6.2 there is support for Apple Silicon: https://www.qt.io/blog/qt-6.2-lts-released

                    iOS has been supported for a long time already. Only QtWidgets does not work on mobile. You have to use QML instead. This is not likely going to change.

                    jsulmJ 1 Reply Last reply 10 Jan 2022, 11:43
                    0
                    • S SimonSchroeder
                      10 Jan 2022, 11:32

                      @RichardPP said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

                      Is there any update for this or does QT just not work with M1 Macs and IOS?

                      Starting with version 6.2 there is support for Apple Silicon: https://www.qt.io/blog/qt-6.2-lts-released

                      iOS has been supported for a long time already. Only QtWidgets does not work on mobile. You have to use QML instead. This is not likely going to change.

                      jsulmJ Online
                      jsulmJ Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on 10 Jan 2022, 11:43 last edited by
                      #10

                      @SimonSchroeder said in Running a Qt app on iOS device from a Mac M1 / Apple silicon:

                      Only QtWidgets does not work on mobile

                      Do you mean on iOS? Because on Android they work as far as I know.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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