How to determine that my iOS app is running in DEBUG mode?

Cherif

The code :

#if DEBUG
    let iAmInDebugMode = true
#else
    let iAmInDebugMode = false
#endif

The project settings :

enter image description here

The scheme settings :

enter image description here

The result :

println(iAmInDebugMode) // false

Why ? What am I doing wrong ?

Adnan Aftab

In swift it will not work like this, you need to set flag inside other swift flags -D DEBUG then it will work. You can get more details about build configuration flags here

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to determine that my iOS app is running in DEBUG mode?

From Dev

Determine if a program is running in debug mode

From Dev

How to debug app in compatibility mode on iOS 7?

From Java

Check if running app is in Debug mode

From Dev

How to determine if iOS has killed my app

From Java

How can I debug my Quarkus application that is running in dev mode?

From Dev

iOS WatchKit - how to determine if your code is running in watch extension or the app

From Dev

Detect Android App Is Running In Debug Mode

From Dev

My Windows Store app is still running in debug mode after I close it

From Dev

How to Determine Trial License in Debug and Release Mode

From Dev

How do I debug my iOS app with Swift

From Dev

Different language for debug and release mode in iOS app?

From Dev

Running different App class in my application (for debug)

From Dev

How to determine the endian mode the processor is running in?

From Dev

How to test my ios app using sandbox mode?

From Dev

How to test my ios app using sandbox mode?

From Java

How can I determine if my React Native app is a debug or release build from JavaScript code?

From Dev

APP crash in debug mode but work fine in release mode on iOS 8

From Dev

How can my iOS app know Appium is running it?

From Dev

How to tell what app is running my iOS 8 Extension

From Dev

Determine if app is running in "scaled" mode on iPhone 6 for keyboard?

From Dev

How can I know if my android app was built in release or debug mode?

From Dev

How to run Dropwizard app in debug mode with Eclipse?

From Dev

How to debug on Google Chrome my React Native application running on physical iOS device

From Dev

How to debug on Google Chrome my React Native application running on physical iOS device

From Dev

Single app mode in my iOS application

From Dev

Determine if application is running in debug mode without using httpcontext. (asp.net)

From Dev

Determine what project id my App Engine code is running on

From Dev

How do I make my debug app version receive production push notifications on iOS?

Related Related

  1. 1

    How to determine that my iOS app is running in DEBUG mode?

  2. 2

    Determine if a program is running in debug mode

  3. 3

    How to debug app in compatibility mode on iOS 7?

  4. 4

    Check if running app is in Debug mode

  5. 5

    How to determine if iOS has killed my app

  6. 6

    How can I debug my Quarkus application that is running in dev mode?

  7. 7

    iOS WatchKit - how to determine if your code is running in watch extension or the app

  8. 8

    Detect Android App Is Running In Debug Mode

  9. 9

    My Windows Store app is still running in debug mode after I close it

  10. 10

    How to Determine Trial License in Debug and Release Mode

  11. 11

    How do I debug my iOS app with Swift

  12. 12

    Different language for debug and release mode in iOS app?

  13. 13

    Running different App class in my application (for debug)

  14. 14

    How to determine the endian mode the processor is running in?

  15. 15

    How to test my ios app using sandbox mode?

  16. 16

    How to test my ios app using sandbox mode?

  17. 17

    How can I determine if my React Native app is a debug or release build from JavaScript code?

  18. 18

    APP crash in debug mode but work fine in release mode on iOS 8

  19. 19

    How can my iOS app know Appium is running it?

  20. 20

    How to tell what app is running my iOS 8 Extension

  21. 21

    Determine if app is running in "scaled" mode on iPhone 6 for keyboard?

  22. 22

    How can I know if my android app was built in release or debug mode?

  23. 23

    How to run Dropwizard app in debug mode with Eclipse?

  24. 24

    How to debug on Google Chrome my React Native application running on physical iOS device

  25. 25

    How to debug on Google Chrome my React Native application running on physical iOS device

  26. 26

    Single app mode in my iOS application

  27. 27

    Determine if application is running in debug mode without using httpcontext. (asp.net)

  28. 28

    Determine what project id my App Engine code is running on

  29. 29

    How do I make my debug app version receive production push notifications on iOS?

HotTag

Archive