Xcode 調(diào)試工具 Chisel 的安裝與使用
Chisel 是 Facebook 出品的一個(gè)功能強(qiáng)大的調(diào)試工具江兢。主要用來(lái)擴(kuò)展原有的 LLDB 調(diào)試命令。
環(huán)境配置
-
首先您的電腦要安裝 homebrew 打開(kāi)終端窗口, 粘貼以上腳本
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
終端顯示
zqldeMacBook-Pro:~ zql$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
/usr/local/sbin
==> The following directories will have their owner set to zql:
/usr/local/.
/usr/local/bin
/usr/local/sbin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
/usr/local/sbin
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/sbin
Password:
==> /usr/bin/sudo /usr/sbin/chown zql /usr/local/. /usr/local/bin /usr/local/sbin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/sbin
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown zql /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 456, done.
remote: Compressing objects: 100% (413/413), done.
remote: Total 456 (delta 26), reused 316 (delta 17), pack-reused 0
Receiving objects: 100% (456/456), 703.58 KiB | 166.00 KiB/s, done.
Resolving deltas: 100% (26/26), done.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
HEAD is now at a9c0361 audit: require plist_options when using plist
==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3657, done.
remote: Compressing objects: 100% (3540/3540), done.
remote: Total 3657 (delta 14), reused 1576 (delta 5), pack-reused 0
Receiving objects: 100% (3657/3657), 2.70 MiB | 222.00 KiB/s, done.
Resolving deltas: 100% (14/14), done.
Checking connectivity... done.
Tapped 3532 formulae (3,683 files, 8.5M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
-
終端輸入:brew install chisel
zqldeMacBook-Pro:~ zql$ brew install chisel ==> Downloading https://github.com/facebook/chisel/archive/1.4.0.tar.gz ==> Downloading from https://codeload.github.com/facebook/chisel/tar.gz/1.4.0 ######################################################################## 100.0% ==> Caveats Add the following line to ~/.lldbinit to load chisel when Xcode launches: command script import /usr/local/opt/chisel/libexec/fblldb.py ==> Summary ?? /usr/local/Cellar/chisel/1.4.0: 22 files, 109.5K, built in 7 seconds zqldeMacBook-Pro:~ zql$
從終端中可以看Caveats下面的那兩行惶洲,意思是把第二行的文字command script import /usr/local/opt/chisel/libexec/fblldb.py添加到.lldbinit文件中,這時(shí)執(zhí)行命令echo command script import /usr/local/opt/chisel/libexec/fblldb.py >> ~/.lldbinit(粗體文字替換為你終端Caveats下面的第二行文字)可免去你去找.lldbinit文件膳犹,或者.lldbinit文件不出現(xiàn)的煩惱啊恬吕。到此步不出意外已經(jīng)安裝成功。
如圖所示
恭喜您已成功安裝了须床!