y_ogagaga hiki  Index  Search  Changes  Login

Mac OS X 固有のコマンド

defaults

用途

plist を 設定値を追加、変更、削除、検索することができる。いつもXcodeのEditorで編集とかしてたけど、 シェルスクリプトと組み合わせると、楽できる場面もありそう。

defaults write:設定値の追加と変更

write <domain> <key> <value>だから

$ defaults write hoge.plist hogekey fugavalue

のように使う。

参考

http://tukaikta.blog135.fc2.com/blog-entry-209.html

otool

Mach-O形式のオブジェクトファイルに関する各種情報を取得するコマンドです。

Emacsの例

$ otool -L /Applications/Emacs.app/Contents/MacOS/Emacs 
/Applications/Emacs.app/Contents/MacOS/Emacs:
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.35.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 103.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.42.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.42.0)

よく使うオプション

$ otool -h [object file]	Mach-O ファイルのヘッダを出力します。
$ otool -L [object file]	リンクされているライブラリ一覧を出力します。
$ otool -l [object file]	Mach-O ファイルに含まれるロードコマンド一覧を取得します。含まれるセグメントの確認に使用します。

class-dump

Cocoaバイナリのヘッダを出力できる

$ class-dump [object file]	

TODO : pb{copy,paste}, mdfind, sips, system_profiler

tmutil (Time Machine管理用コマンド)

Time MachineのローカルスナップショットのON/OFF

$ sudo tmutil disablelocal
$ sudo tmutil enablelocal

スタップショットを作成する

1時間ごとで困る場合は、

$ tmutil snapshot

を実行すると即座に作成される

ここに詳しい記載があった

http://news.mynavi.jp/column/osxhack/044/index.html

Last modified:2012/08/30 17:30:01
Keyword(s):
References:[Mac OS X]