Can ipa file be created in debug mode?

后端 未结 2 1278
盖世英雄少女心
盖世英雄少女心 2021-02-20 04:57

Two questions on ipa files.

  • Can ipa file be created in debug mode? If so, how do you archive the file in debug mode?
  • Our ipa file, after installed to a de
2条回答
  •  面向向阳花
    2021-02-20 05:33

    About the first question, yes, you can archive an app in Debug mode. From Xcode, browse the Product menu, Scheme, Manage Schemes, Edit. Select the Archive action on the left pane and choose Debug as Build Configuration in the drop down box.

    If you want to restrict logging only to Debug configurations, you can add this to your ProjectName-Prefix.pch file:

    #ifdef DEBUG
    #define XYZLog(format, ...) NSLog(format, ## __VA_ARGS__)
    #else
    #define XYZLog(format, ...)
    #endif
    

    Where "XYZ" is the three letter prefix for your application (Cocoa naming convention).

    Then you must use XYZLog instead of NSLog in your code and the output will only go to the console for Debug versions.

提交回复
热议问题