2012-03-31 72 views
3

網路上的我看到人們張貼這樣的事情:如何開啓Cocos2D CCLOG調試模式?

2012-03-12 10:26:32.495 squirrels[330:707] cocos2d: OS version: 5.1 (0x05010000) 
2012-03-12 10:26:32.498 squirrels[330:707] cocos2d: GL_VENDOR: Imagination Technologies 
2012-03-12 10:26:32.501 squirrels[330:707] cocos2d: GL_RENDERER: PowerVR SGX 543 
2012-03-12 10:26:32.503 squirrels[330:707] cocos2d: GL_VERSION: OpenGL ES 2.0 IMGSGX543-63.24 
2012-03-12 10:26:32.505 squirrels[330:707] cocos2d: GL_MAX_TEXTURE_SIZE: 4096 
2012-03-12 10:26:32.507 squirrels[330:707] cocos2d: GL_MAX_TEXTURE_UNITS: 8 
2012-03-12 10:26:32.508 squirrels[330:707] cocos2d: GL_MAX_SAMPLES: 4 
2012-03-12 10:26:32.510 squirrels[330:707] cocos2d: GL supports PVRTC: YES 
2012-03-12 10:26:32.511 squirrels[330:707] cocos2d: GL supports BGRA8888 textures: YES 
2012-03-12 10:26:32.513 squirrels[330:707] cocos2d: GL supports NPOT textures: YES 
2012-03-12 10:26:32.515 squirrels[330:707] cocos2d: GL supports discard_framebuffer: YES 
2012-03-12 10:26:32.516 squirrels[330:707] cocos2d: compiled with Profiling Support: NO 
2012-03-12 10:26:32.519 squirrels[330:707] cocos2d: cocos2d v2.0.0-beta2 
2012-03-12 10:26:32.522 squirrels[330:707] cocos2d: Using Director Type:CCDirectorDisplayLink 

然而,當我運行在調試模式下應用程序,我沒有得到這樣的日誌。有沒有辦法使用Cocos2D 2.0打開它?如果是這樣,怎麼樣?

謝謝!

+0

我找到了答案。你所要做的就是把#define COCOS2D_DEBUG 1放到你的.pch文件中,這就是它! – 2012-03-31 20:02:53

回答

8

添加此語句將PCH文件:

#define COCOS2D_DEBUG 1

這應該設定優先將其打開。

+0

格式說明符:http://www.cocos2d-x.org/wiki/How_to_use_CCLOG此外,在樣本中搜索「CCLOG」以查看更多格式說明符的用法 – TigerCoding 2014-02-20 13:42:47

+0

注意:COCOS2D_DEBUG在Xcode構建設置中設置,所以先在那裏檢查。 – Droppy 2014-07-30 07:34:38

0

,使茯苓調試,我添加這些線在我Application.mk

APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -fsigned-char 
APP_OPTIM := debug 
相關問題