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. Detect iOS Simulator with QMake. How?
Forum Updated to NodeBB v4.3 + New Features

Detect iOS Simulator with QMake. How?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 481 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.
  • B Offline
    B Offline
    bogong
    wrote on last edited by bogong
    #1

    Hello all!

    In one of later projects been using this in *.pro file for detecting iOS Simulator:

    ios {
       message(iOS)
    }
    simulator {
       message(Simulator)
    }
    

    For now it's not working properly. Message appearing for both iOS Device and iOS Simulator.
    Is there any way to detect when iOS Simulator and when iOS Device?

    The global problem for now is that new M1 Macbook/iMac is arm64 and therefore appearing conflict when you using arm64 for iPhone and arm64 for Simulator. Previously been using fat *.a static lib where were arm64 and x86_64 for all of them. For now for Simulator it might be arm64 and x86_64 and for iPhone arm64. "lipo" making error because of duplicated arch.

    Is there any info how to solve this issue?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote on last edited by
      #2

      Solution found.

      CONFIG(iphoneos,iphoneos|iphonesimulator):message(Detect iphoneos)
      CONFIG(iphonesimulator,iphoneos|iphonesimulator):message(Detect iphonesimulator)
      

      In case of using for different iOS Simulators arch might be used "$$QMAKE_HOST.arch".

      equals($$QMAKE_HOST.arch,arm64):message(Detect arm64)
      equals($$QMAKE_HOST.arch,x86_64):message(Detect x86_64)
      
      1 Reply Last reply
      2

      • Login

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