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. Can I build for Android on Ubuntu(Linux) and use the same project to deploy for iOS using a Mac?

Can I build for Android on Ubuntu(Linux) and use the same project to deploy for iOS using a Mac?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 5 Posters 1.9k 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.
  • T Offline
    T Offline
    theBCWIntern
    wrote on last edited by
    #1

    My employer has tasked me with building a Cross-Platform application. The workstation runs Ubuntu. I realize I will need Mac OS X and Xcode to build iOS applications with QT.

    So, My question here is -

    Can I develop an application(QT Quick control application) for Android on my linux. Then, take the files to a Mac, (install QT, Xcode and get iOS dev account etc.) and open the project to then deploy it on an iOS device?

    In other words, Does the code remain the same? Can I develop on Linux and then use a Mac to deploy it to iOS?

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

      Hi and welcome to devnet,

      Yes, that's one of the goal of Qt: write once, compile everywhere. Note that you can as well do all the development on the Mac machine. Android development is supported on all three desktop OS.

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

      T 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi and welcome to devnet,

        Yes, that's one of the goal of Qt: write once, compile everywhere. Note that you can as well do all the development on the Mac machine. Android development is supported on all three desktop OS.

        T Offline
        T Offline
        theBCWIntern
        wrote on last edited by
        #3

        @SGaist Yes, I do know that I can develop for Android on any OS. But the Mac machine at office is in use and cannot be given for daily use to me. So, I can use it only to deploy it to iOS when needed.
        So I'm guessing that's good enough. I can write in Linux, then copy the files to Mac and then just deploy it to iOS without any changes. Right?

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

          You should rather use something like Git to properly handle your sources. That will make it also easier to transfer between the OS as well as avoid problems with line ending handling.

          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
          3
          • G Offline
            G Offline
            Gourmet
            wrote on last edited by
            #5

            Be careful. Not all OS features can be used from Qt. My Qt apps have about 500 lines of Java code and bunch of callObjectMethod() calls from C++ code. All this cannot work on iOS. It is necessary to build working application for Android. Of course it depends from Qt version you use and from application features you need. But I do not think it is possible create powerful app only on Qt without using platform calls.

            1 Reply Last reply
            1
            • T theBCWIntern

              My employer has tasked me with building a Cross-Platform application. The workstation runs Ubuntu. I realize I will need Mac OS X and Xcode to build iOS applications with QT.

              So, My question here is -

              Can I develop an application(QT Quick control application) for Android on my linux. Then, take the files to a Mac, (install QT, Xcode and get iOS dev account etc.) and open the project to then deploy it on an iOS device?

              In other words, Does the code remain the same? Can I develop on Linux and then use a Mac to deploy it to iOS?

              timdayT Offline
              timdayT Offline
              timday
              wrote on last edited by
              #6

              @theBCWIntern Yes, I do pretty much what you propose... develop simple QtQuick (QML & C++) applications on mainly my Linux desktop. I also build for and deploy to Android from there. For OSX and iOS I build on a Mac (xcode needed to deploy to iOS and the appstore). My QML and C++ sources are pretty much the same for all platforms apart from a very few #ifdef guarded sections of C++ where platform-specific quirks creep in. (I also occasionally build for Windows on a Windows VM). However... I don't use Creator; I prefer to use build scripts... too many platform differences around deployment/packaging/metadata and I like to be in control of what's going on. Also, my apps are simple self-contained "ebook" type things and don't interact much with the platform... the more you want to integrate with platform features which can't be accessed by a uniform Qt API the more likely it is you'll have to write platform-specific code (like @Gourmet describes above).

              1 Reply Last reply
              1
              • Uncle_MastaU Offline
                Uncle_MastaU Offline
                Uncle_Masta
                wrote on last edited by
                #7

                @timday said in Can I build for Android on Ubuntu(Linux) and use the same project to deploy for iOS using a Mac?:

                You've got it right. In the simplest case, no code changes and a simple .pro file. But, if you're linking in libraries, doing network calls over ssl, or doing anything that requires native code, it can get tricky.

                • compiler directive differences: clang vs g++
                • android gradle files
                • mac tools for frameworks

                It's all doable, but it took some work to figure out.

                1 Reply Last reply
                1

                • Login

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