Building for release and disabling logs on Android

I’m following the cross-platform project model outlined here: http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started.

What makefile or build settings do I need to change for a release build where assertions and logs are disabled?

I’ve tried adding this to the Android.mk file:

LOCAL_CFLAGS += -DCOCOS2D_DEBUG=0

However, I still see log output, and assertions trigger as normal! My build command is:

bash build_native.sh NDK_DEBUG=0 V=0

I thought that with all of these flags I’d be fully in “release” mode, but it seems not…

I am also interested

There is something new

thanks
Don

so, any answer now Craig ?

I’m glad this was bumped. This seems essential. Even if it is rare, seeing a cocos2d-x assertion dialog when you’re an end user is really lame.

Well i’m just trying to compile in release mode , how do we do that ?

edit: http://developer.android.com/tools/publishing/app-signing.html#cert

Did you ever find a solution?

yeah: http://developer.android.com/tools/publishing/app-signing.html#cert

for iOS is usually disable the CC_LOG by putting a return inside the function. because i’m not so sure about what gets into the archive.

for android I don’t do that, not sure why.

Oh, alright, thanks!
Assertions are turned off for release build for Android and iOS, correct?

I don’t think so, but i’m not sure about it.
(I’m using a self defined macro for assertions, that sends the error to my server.)

I was going to use my own internal logger for that too,
but what I meant was cocos2d-x library assertions (CCNode, CCObject, etc). Sometimes they happen and it’d be unpleasant to get one as a user

LOCAL_CPPFLAGS := -DCOCOS2D_DEBUG=0

I don’t know if you search for it, but I edit this code:

@
private static void showDialog(final String pTitle, final String pMessage) {
**if *
Cocos2dxHelper.sCocos2dxHelperListener.showDialog;
}@

in Cocos2dxHelper.java
In my debug I had seen that this code show an Alert when assert happens.
I did this code some time ago so I do not remember if needed only COCOS2D_DEBUG, but if I added this control, it means that the assert wasn’t blocked. Try it, then tell me.
Also**COCOS2D_DEBUG* it’s important, as Sergey says (you have to set it in the Android.mk file)
COCOS2D_DEBUG avoid also other logs (when you use CCLOG all uppercase)

EDIT: to understand search for showDialogJNI and CCMessageBox
You can see that CCFileUtils::getFileData use CCMessageBox to show an error