Update 7.12.2020: Added info at the bottom about a UserDefaults setting you can use instead.
If you build iOS apps, you’re used to providing all icons and other images in @1x and @2x versions for older and Retina screens respectively (or rather @2x and @3x now). And it’s pretty easy to test if all those versions work or not, by starting the right iOS simulator and looking at it scaled to 100%.
If you work on Mac apps, you should also include @2x images for Retina Macs now; but if you’re like me, you might have treated that so far as something not urgent that can be done later…
When you do get around to that, if you don’t have any Retina Mac yet, you’ll quickly notice a problem: how do you test your app on a Retina screen? There’s no OSX simulator in Xcode, after all.
Fear not, turns out there is a tool that lets you turn your Mac into a Retina MacBook simulator, it’s just pretty well hidden.
First, go to the Downloads page on developer.apple.com and find the latest “Graphics Tools for Xcode” package on the list (you might find many versions, but the latest should be on the first or second page – right now it’s the Xcode 6.1 version from Oct 2014). This includes various thingies that were distributed with Xcode before and could be found in
/Developer, but now were removed from the main bundle.
Open the DMG and run the Quartz Debug tool (you don’t need to extract it anywhere, you only need to do this once). It will show you a small HUD window, but ignore it and instead open the “UI Resolution” panel that you can find in the Window menu:
See that checkbox? Yeah, you need to check it. And unfortunately you’ll need to either log out and back in or restart your computer for this to work. You can close Quartz Debug and you can even delete the DMG (though some of the other tools there might be useful too, e.g. Icon Composer).
When you’re back, open the standard Displays panel in the System Preferences, and you should see at least one additional resolution on the list – this will be a special @2x mode that runs at half your normal resolution:
When you select that, your desktop will look a bit funny and you’ll have much less space, but you’ll be able to see which of the icons and controls adapt to a Retina screen properly. This is the result of doing this on my iMac (it turned the standard 1920×1080 resolution into 960×540@2x):
It does work on smaller screens too, but the effective resolution gets really small so it’s not as comfortable; here’s a screenshot from my MacBook Air at 720×450@2x (as you can see, Xcode is not terribly usable at such resolution :).
BTW, prepare to feel confused for a few minutes after you switch back – the cursor movement and animation will feel slower and so on :) All the windows will also stay resized to much smaller dimensions, and iPhoto might start complaining about having to generate @2x thumbnails (it’s probably better to not have it running while you’re doing this).
Update 7.12.2020: Turns out that there is also a secret UserDefaults setting that you can set in the terminal that lets you enable the HiDPI modes without installing any additional tools:
sudo defaults write /Library/Preferences/com.apple.windowserver.plist \ DisplayResolutionEnabled -bool true
You still need to restart the computer for this to take effect.