Mac OS X : Delete Sleep Image

Mac Tips For iOS Developers

Mac OS X maintains an image of memory when going to sleep. This same file is read upon waking up to restore the desktop to the same state as going sleep.

The sleepimage is located in the folder /private/var/vm. You can view the file as shown below:

I have 8Gig of memory on this machine, notice the sleepimage file is the same size.

A few times have come up where deleting the sleepimage has been helpful. For example, when upgrading to a new OS my system would reboot after each sleep cycle. Once I deleted the sleepimage, the sleep/restore cycle worked as expected.

To Delete Mac OS X SleepImage

sudo rm /private/var/vm/sleepimage

Before the file is deleted you will be prompted for the admin password.

Mac OS X : Display Library Folder in Finder

Mac Tips For iOS Developers

Beginning with Mac OS X 10.7 (Lion) the Library folder folder is hidden by default. As a developer there are times that accessing this folder is necessary. For example, ~/Library/MobileDevice contains folders for iOS applications, devices and profiles – there have been any number of times I’ve found it helpful to clean up the profiles folder so Xcode isn’t overloaded with options for code signing.

To reset the Library folder so it is no longer hidden, from a terminal enter the following:

chflags nohidden ~/Library/

Should you choose to send the folder back to a hidden state:

chflags hidden ~/Library/

Go To Library Folder

On a similar note, here are a few ways to get to the Library folder:

– From Finder hold down the Option key when viewing the Go menu, the Library folder will be shown.

– When Finder window is active, press Shift-Command-g and enter ~/Library in the dialog.

– If you are in a terminal, you can enter: cd ~/Library.

All three options above will work regardless of whether or not the Library folder is hidden.