Search code examples
iosconsolecocos2d-iphone

Is there is any way to programatically clear the console of Xcode during scene change/ function call?


I am developing an iOS app using cocos2d.

My question is:

Is there is any way to programatically clear the console of Xcode during scene change or function call?

I found several duplicates of my posts in stack overflow also, but nothing gave me a correct solution.

What I do not need:

  • Please do not post any method to change settings on Xcode's preferences.
  • Please do not post any keyboard methods (shortcuts).

What I will appreciate:

  • A good programmatical method to clear the Xcode console, that can be used inside any cocos2d application code.

Thanks.


Solution

  • This begs the question: why???

    The best you can do is:

    NSLog(@"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
    

    A good way is to just copy&paste the contents of the log into a text editor, and do so before/after changing scenes and perhaps edit/crop the log in the text editor.