Building for release and disabling logs on Android

Building for release and disabling logs on Android
0.0 0


I’m following the cross-platform project model outlined here:

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 file:


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

bash 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



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 ?



Did you ever find a solution?



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




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 *

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 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