Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fender2112

macrumors 65816
Original poster
Aug 11, 2002
1,141
402
Charlotte, NC
"What is the clear screen command for Xcode?" Since I started back learning to program about a year ago, I have seen this question pop up several times. When you use the proper command, at least for c++, Xcode will give you a "Term environment error" of some sort. If you run the program from Terminal, the system("clear"); command works fine.

If you're like me, I'm not fimiluar with Terminal and would perfer the Xcode log window to clear each time a run a program. There is a small "x" at the lower right corner of the log window that will clear the screen, But that's an extra click I can do without. Fret no more, I discovered a few moments ago that there is a preference setting that clears the log automatically. I am so over joyed that had to share this with everyone who has ever felt my pain.

From the Xcode menu: Preference > General > Environment put a check where is says "Automatically clear log".

I can rest better now. :D
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
Yay! One minor annoyance in my life, gone!
Thanks for taking the time to post this...
 

Soulstorm

macrumors 68000
Feb 1, 2005
1,887
1
Some more info here...

Although the Xcode compiler emulates the terminal's commands, it hasn't yet implemented the commands for the clear screen. As such, the command system("clear"); will not work in Xcode, but it will work in the Terminal, and it will clear the screen.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.