Rocky
Rocky

Reputation: 289

Can ipa file be created in debug mode?

Two questions on ipa files.

My environment Xcode 4.6 and iOS 5 & 6.

Upvotes: 14

Views: 17190

Answers (2)

WrightsCS
WrightsCS

Reputation: 50707

So to create a debuggable IPA, you will need to Archive it and save for Ad-Hoc or Enterprise.

As far as logging to the console in this ad-hoc build, there are several ways to do this, see this answer.

Upvotes: 1

Daniel Martín
Daniel Martín

Reputation: 7845

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.

Upvotes: 28

Related Questions