Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear console programmatically in Xcode?

I have a bunch of NSLog statements in my code which I use for debugging. Every time I run my Project I'd like to start from a fresh console screen. Is there any command I can embed in my code which can do this?

like image 666
NSExplorer Avatar asked Jan 04 '11 14:01

NSExplorer


People also ask

How do I see console in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console".


2 Answers

When in the console (Debug mode), use:

Xcode > Debug > Debug Workflow > Clear Console 

Keyboard Shortcut: Command ⌘+K

like image 69
Ashwani Avatar answered Oct 06 '22 08:10

Ashwani


Swift

print("any value", terminator: Array(repeating: "\n", count: 100).joined()) 

Objective-C

I think the only thing you can is

for(int i= 0; i < 100; i++)  NSLog(@" "); 

just like in good old MS-DOS :)

like image 34
Tertium Avatar answered Oct 06 '22 07:10

Tertium