是否可以在调试模式下创建ipa文件? [英] Can ipa file be created in debug mode?

查看:82
本文介绍了是否可以在调试模式下创建ipa文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于ipa文件的两个问题.

Two questions on ipa files.

  • 可以在调试模式下创建ipa文件吗?如果是这样,如何在调试模式下存档文件?
  • 我们的ipa文件安装到设备后,会将我们的日志输出到控制台.我们可以禁用到控制台的日志记录功能吗?

我的环境Xcode 4.6和iOS 5& 6.

My environment Xcode 4.6 and iOS 5 & 6.

推荐答案

关于第一个问题,是的,您可以在调试"模式下存档应用程序.在Xcode中,浏览产品菜单,方案管理方案编辑.在左窗格中选择 Archive 操作,然后在下拉框中选择 Debug 作为Build Configuration.

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.

如果您只想将日志记录限制为调试配置,则可以将其添加到您的ProjectName-Prefix.pch文件中:

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

"XYZ"是应用程序的三个字母前缀(可可命名约定).

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

然后,您必须在代码中使用XYZLog而不是NSLog,并且输出将仅进入控制台以显示Debug版本.

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

这篇关于是否可以在调试模式下创建ipa文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆