How to clear console programmatically in Xcode?

Maybe you could use the "Auto Clear Debug Console" setting in the Xcode Preferences...

Don't know if this answers your question?


If you are talking about the console in the Xcode window there is a "Clear Console" option in the "Run" menu. There is also, in the "Debugging" Preferences tab an "Auto Clear Debug Console" checkbox. I am referring Xcode 3.2.x


When in the console (Debug mode), use:

Xcode > Debug > Debug Workflow > Clear Console

Keyboard Shortcut: Command ⌘+K


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