Debug message #27

Closed
opened 2025-12-29 18:28:18 +01:00 by adam · 8 comments
Owner

Originally created by @Arti3DPlayer on GitHub (Mar 30, 2016).

I added -DDebug flag to my project.

screen shot 2016-03-30 at 16 19 49

Then in code did:

#if Debug
     Armchair.debugEnabled(true)
 #endif

But always get message:

[Armchair] Debug is disabled on release builds.
[Armchair]   If you really want to enable debug mode,
[Armchair]   add "-DDebug" to your  Swift Compiler - Custom Flags
[Armchair]   section in the target's build settings for release

Source:

public func debugEnabled(debugEnabled: Bool) {
#if Debug
    Manager.defaultManager.debugEnabled = debugEnabled
#else
    print("[Armchair] Debug is disabled on release builds.")
    print("[Armchair]   If you really want to enable debug mode,")
    print("[Armchair]   add \"-DDebug\" to your  Swift Compiler - Custom Flags")
    print("[Armchair]   section in the target's build settings for release")
#endif
}
Originally created by @Arti3DPlayer on GitHub (Mar 30, 2016). I added -DDebug flag to my project. ![screen shot 2016-03-30 at 16 19 49](https://cloud.githubusercontent.com/assets/3278913/14143327/5feb17cc-f693-11e5-88c2-04d443f9d8a3.png) Then in code did: ``` #if Debug Armchair.debugEnabled(true) #endif ``` But always get message: ``` [Armchair] Debug is disabled on release builds. [Armchair] If you really want to enable debug mode, [Armchair] add "-DDebug" to your Swift Compiler - Custom Flags [Armchair] section in the target's build settings for release ``` Source: ``` public func debugEnabled(debugEnabled: Bool) { #if Debug Manager.defaultManager.debugEnabled = debugEnabled #else print("[Armchair] Debug is disabled on release builds.") print("[Armchair] If you really want to enable debug mode,") print("[Armchair] add \"-DDebug\" to your Swift Compiler - Custom Flags") print("[Armchair] section in the target's build settings for release") #endif } ```
adam closed this issue 2025-12-29 18:28:18 +01:00
Author
Owner

@coneybeare commented on GitHub (Mar 30, 2016):

You have to add the flag to the pod project

@coneybeare commented on GitHub (Mar 30, 2016): You have to add the flag to the pod project
Author
Owner

@Arti3DPlayer commented on GitHub (Mar 31, 2016):

How to do this ?

@Arti3DPlayer commented on GitHub (Mar 31, 2016): How to do this ?
Author
Owner

@Arti3DPlayer commented on GitHub (Mar 31, 2016):

Ah, ok i understand

@Arti3DPlayer commented on GitHub (Mar 31, 2016): Ah, ok i understand
Author
Owner

@nataliachodelski commented on GitHub (May 19, 2016):

@Arti3DPlayer & @coneybeare I'm going thru different areas trying to add the -DDebug flag and still haven't worked it out. No matter what I've tried i get the "Debug is disabled on release builds. If you really want to enable debug mode, add "-DDebug" to your Swift Compiler - Custom Flags section in the target's build settings for release" message. I thought I had finally found the Custom Complier Flags in the Pods Project Settings, but Armchair rating prompt is still not showing and now i get the above "Debug Warning" message 2 x when the project builds.

Could you pretty please explain how you figured this out Arti3DPlayer? Ideally if you could post a picture of xcode showing the area of the project and the area of the build settings where you find and add the flag, that would be super helpful.

What I have tried so far:
screen shot 2016-05-18 at 4 48 07 pm
screen shot 2016-05-18 at 4 47 49 pm

Code to show prompt, and note warning about -DDebug flag in log. I followed the Example AppDeleagte setup code exactly in my AppDelegate file (other than changing app #), and took the demo prompt code from the example project as well. Example project builds and Armchair prompts fine on my device...but not in my own project.

screen shot 2016-05-18 at 4 51 40 pm
@nataliachodelski commented on GitHub (May 19, 2016): @Arti3DPlayer & @coneybeare I'm going thru different areas trying to add the -DDebug flag and still haven't worked it out. No matter what I've tried i get the _"Debug is disabled on release builds. If you really want to enable debug mode, add "-DDebug" to your Swift Compiler - Custom Flags section in the target's build settings for release"_ message. I thought I had finally found the Custom Complier Flags in the Pods Project Settings, but Armchair rating prompt is still not showing and now i get the above "Debug Warning" message 2 x when the project builds. Could you pretty please explain how you figured this out Arti3DPlayer? Ideally if you could post a picture of xcode showing the area of the project and the area of the build settings where you find and add the flag, that would be super helpful. What I have tried so far: <img width="1035" alt="screen shot 2016-05-18 at 4 48 07 pm" src="https://cloud.githubusercontent.com/assets/10591026/15378456/82b304bc-1d18-11e6-89f4-2edda8027755.png"> <img width="1042" alt="screen shot 2016-05-18 at 4 47 49 pm" src="https://cloud.githubusercontent.com/assets/10591026/15378457/82b39e72-1d18-11e6-9fe2-509216701da1.png"> Code to show prompt, and note warning about -DDebug flag in log. I followed the Example AppDeleagte setup code exactly in my AppDelegate file (other than changing app #), and took the demo prompt code from the example project as well. Example project builds and Armchair prompts fine on my device...but not in my own project. <img width="871" alt="screen shot 2016-05-18 at 4 51 40 pm" src="https://cloud.githubusercontent.com/assets/10591026/15378505/e21575b6-1d18-11e6-8a17-cfa3ea4197e3.png">
Author
Owner

@Arti3DPlayer commented on GitHub (May 19, 2016):

@nchodelski you were close.

select Armchair project and set -DDebug flag here

@Arti3DPlayer commented on GitHub (May 19, 2016): @nchodelski you were close. ![](https://cloud.githubusercontent.com/assets/10591026/15378457/82b39e72-1d18-11e6-9fe2-509216701da1.png) select Armchair project and set `-DDebug` flag here
Author
Owner

@nataliachodelski commented on GitHub (May 21, 2016):

Thanks for the advice re where to set the flag. I have tried setting -DDEBUG specifically for the Armchair target within the Pods Project as you described but I still have the same result. It really is weird. I made my own issue about it....maybe I can get to the bottom of it eventually.

For now I worked around it by temporarily modifying Armchair.swift to think it's in debug mode all the time....total hack but it works great for testing! Lol.

@nataliachodelski commented on GitHub (May 21, 2016): Thanks for the advice re where to set the flag. I have tried setting -DDEBUG specifically for the Armchair target within the Pods Project as you described but I still have the same result. It really is weird. I made my own issue about it....maybe I can get to the bottom of it eventually. For now I worked around it by temporarily modifying Armchair.swift to think it's in debug mode all the time....total hack but it works great for testing! Lol.
Author
Owner

@Arti3DPlayer commented on GitHub (May 23, 2016):

@nchodelski i noticed that you write -DDEBUG with uppercase. But it should -DDebug. Method that i showed you works for me and other guys.

screen shot 2016-05-23 at 13 11 06

@Arti3DPlayer commented on GitHub (May 23, 2016): @nchodelski i noticed that you write `-DDEBUG` with uppercase. But it should `-DDebug`. Method that i showed you works for me and other guys. ![screen shot 2016-05-23 at 13 11 06](https://cloud.githubusercontent.com/assets/3278913/15467641/4aacd9c0-20e8-11e6-80fd-ee55673bba85.png)
Author
Owner

@nataliachodelski commented on GitHub (May 23, 2016):

Wow, that was it. When i used "DDebug" Armchair debug mode worked perfectly! I'm amazed it was actually such a simple thing. I had been using it as "DDEBUG" in capitals because in every example I saw of how to add the flag, it was always written or shown as "-DDEBUG" in all caps. I didn't realise it was case sensitive.

Thanks very much for that tip!!

@nataliachodelski commented on GitHub (May 23, 2016): Wow, that was it. When i used "DDebug" Armchair debug mode worked perfectly! I'm amazed it was actually such a simple thing. I had been using it as "DDEBUG" in capitals because in every example I saw of how to add the flag, it was always written or shown as "-DDEBUG" in all caps. I didn't realise it was case sensitive. Thanks very much for that tip!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Armchair#27