How do I change screen resolution in command line?

Hi, I was controlling a remote server by Apple Remote Desktop and have lost control of it after changing the resolution. Is there a way to change the resolution in the command line, without restarting?

If I can screen resolution in the command line I can send the unix command to the remote server and hopefully fix my problem.

MacBook 2 GHz, Mac OS X (10.5.2)

Posted on Apr 22, 2008 10:18 PM

Reply
2 replies

Apr 23, 2008 8:12 PM in response to sp0radic

Hi, I'm not aware of a way to do it without a little work. For example, I found some code at Mac OS X Hints that will change the screen resolution from a command line, but you'd have to compile it. It compiled for me on 10.4.11, and the poster there said it compiles on 10.5 for him.

If you have the Xcode tools installed on your Mac, just copy that code into a plain text file, then save it as "main.c". Then, in Terminal, change directory to the same directory as that file and compile it:

<pre class="command">gcc -o newscreen main.c -framework ApplicationServices</pre>

Then copy it to your server and try running it there:

<pre class="command">./newscreen -h nnnn -v nnnn</pre>

where "nnnn" is the desired resolution...

I hope that works, anyway, since I'm still using Tiger...

charlie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I change screen resolution in command line?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.