Darwin
Darwin 是開源的。但ios 版不是奥秆。
uname -a //查看當(dāng)前的版本
Darwin Yonglins-Mini.lan 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
Mac系統(tǒng)的環(huán)境變量丈秩,加載順序為:
/etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc
常用工具安裝
Xcode Commandline Tools:
xcode-select —install
installed path: /Library/Developer/CommandLineTools
brew
安裝:訪問 http://brew.sh
常用命令:
brew list
brew update
brew install gdb/lua
brew install aircrack-ng
Finder:
Cmd+ Shift + U //Open utility directory
Terminal Command
cd - // Back to where you were
tail -f filename //Follow a file
mkdir -p /dir1/dir2/dir3
Cmd+ K //Clear
Cmd+ +/- //Resize
Ctrl+ a/e //move to the beginning or end of the line
echo $SHELL //show default shell
echo $0 //show current shell
wifi
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
airport -I
airport -s
sudo airport sniff channel
aircrack-ng *.cap | grep 1_ handshake
aircrack-ng -w password.txt -e SSID capfilename.cap
unrar
解壓文件:
unrar x filename.rar -ppassword //-photnrg -pwww.pt80.com
Filemonitor:
sudo fse
解壓文件
tar -xzvf vlc-ios-2.7.8.tar.gz
tar -xzvf *.tgz
gunzip xxx.tar.xz
tar xvd xxx.tar
sudo systemsetup -getremotelogin
sudo systemsetup -setremtelogin on/off
otool nm
dyldinfo
Leopard(10.5) is the first OS X which got UNIX certification
client port error while execute mdfind.
Metadata.framework [Error]: couldn't get the client port
execute
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
to enable Spotlight and sudo mdutil -i off /
to disable indexing.
Find
Find *.c files which contain PANIC
find ./ -name "*.c" | xargs grep PANIC
C++
gcc -framework ApplicationServices -framework SystemConfiguration QueryConf.c -o queryconf
gcc -lstdc++
gcc
gcc -std=c89
gcc -ansi
Chapter 2
The first user mode process is launchd.
Darwin is a UNIX implementation. 10.5 is the first OS X which get certified.
To enable ssh on OS X, open the ssh.plist under /System/Library/LaunchDaemons. Then change the value for disable to false. Or remove the key completely.
應(yīng)用程序的默認(rèn)設(shè)置保存在屬性列表中岂丘。 ~/Library/Preferences 或 /Library/Preferences
命令: defaults
LaunchServices 框架負(fù)責(zé)使用關(guān)聯(lián)的程序打開文件施无。 和 launchd 無關(guān)梦碗。LaunchServices 的數(shù)據(jù)庫可以用 lsregister 程序?qū)С觥?br>
reset the database. lsregister -kill -r -domain local -domain system -domain user
Framework bundle 內(nèi)建版本化機(jī)制 框架可以包含多個版本的代碼
Cocoa 框架包含了其他3個框架:Appkit, CoreData 和 Foundation.
框架是特殊形式的庫
otool可以對二進(jìn)制文件進(jìn)行反匯編(-tV)
otool -L libSystem.B.dylib // Check the dependency of a library
otool -arch i386 -tV /usr/lib/libSystem.B.dylib | more
otool -arch x86_64 -tV /usr/lib/libSystem.B.dylib | more
dyld // Mach-O 加載器