Xcode DEBUG Mode - when is it on/off?

前端 未结 2 648
心在旅途
心在旅途 2021-01-01 12:56

I have noticed that this works in dev mode (testing on the simulator, etc):

#ifdef DEBUG
    //do stuff
#endif

But when I archive and distr

相关标签:
2条回答
  • 2021-01-01 13:21

    The current version of Xcode automatically sets the DEBUG macro in new projects. It does this only for Debug build mode however.

    You can edit this in your projects Build Settings.

    I recommend you add a new, separate macro instead of editing the DEBUG one. Maybe you could add a DISTRIBUTION or DEPLOYMENT macro only for the release mode.

    enter image description here

    0 讨论(0)
  • 2021-01-01 13:24

    enter image description here

    You can also "Edit Scheme" to build Debug Configuration when archiving. See screenshot of "Edit Scheme" dialog in XCode.

    0 讨论(0)
提交回复
热议问题