项目打包去掉调试时的NSLog、print
2019獨角獸企業重金招聘Python工程師標準>>>
在開發中,為了便于調試經常使用nslog 和 print , 但是這些輸出會影響APP的性能,xcode中使用scheme解決這個問題問題。
步驟:
? ? 首先在pch文件中添加
#ifdef DEBUG
# define? DLog(...) print(__VA_ARGS__)
#else
# define DLog(...)
#endif
首先點擊xcode導航欄的(形式大寫A的圖標)targets,選中new scheme彈出alert,將name改為PresentationLayer,此時選中新建的PresentationLayer;
在點擊此處選中Edit scheme,在alert中左邊選中run,右邊選擇info,將Build Configuration值選為Release,點擊OK;
然后選中target->Build Settings->Apple LLVM7.1-Preprocessing->PreProcessor Macros->Debug雙擊空白添加DEBUG或者DEBUG=1
當我們想要出去NS�Assert時,target->Build Settings->Apple LLVM7.1-Preprocessing->PreProcessor Macros->Release雙擊空白添加NS_BLOCK_ASSERTIONS
?
轉載于:https://my.oschina.net/u/2532095/blog/698432
總結
以上是生活随笔為你收集整理的项目打包去掉调试时的NSLog、print的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql数据库主从同步配置教程--数据
- 下一篇: IOS热更新-JSPatch实现原理+P