Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save githubutilities/0fb084149c99600c6d9a to your computer and use it in GitHub Desktop.
Save githubutilities/0fb084149c99600c6d9a to your computer and use it in GitHub Desktop.
Mac OS X app hacks

OS X app hacks

Info.plist

Icon size

pkg file analysis

pkg is just a xar archieve which contains a header, a table of contents and a heap that stores actual data.

# extract pkg file
xar -xf <your-pkg-file>

# pack current folder into pkg file
xar -cf <your-pkg-file> .

here is the common folder structure:

Distribution -- xml config file

Resources -- resources that mainly used by Distribution xml config used

background-images

en.lproj -- language specific resources

welcome.rtf

licence.rtf

readme.rtf

Localizable.strings

conclusion.rtf -- rtfd also can be used

*.pkg -- * means any non empty file name, a pkg file can contain multiple folder like this to achieve selective install.

Bom -- (Mac OS X bill of materials (BOM) file), contains information on the files inside that cpio archive

PackageInfo -- package specific xml config

Payload -- compressed data, probably gzip, it can contains package like .app, kext. Try to extract it using zip to see more info.

Scripts -- compressed data, probably gzip, it can contains scripts like postinstall, preinstall. Try to extract it using zip to see more info.

Reference

Mac OS X spinning wheel death

In my case, SBBOD frequently appears when I select a folder in Finder. So it's probably because hard disk has been put to sleep due to the energy saving option.

To solve it,

  • Command+Option+Shift+Escape to force quit Finder
  • Change the energy saving option in Settings

Reference

Lock My Mac In Command Line

# lock your mac immediately
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

# add this to your .bashprofile
alias lockscreen='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend'

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment