1. 簽名證書準(zhǔn)備
1.1 第一步:創(chuàng)建證書
- 打開
鑰匙串訪問
柱告; - 菜單欄中選擇
鑰匙串訪問
-證書助理
-創(chuàng)建證書
開始創(chuàng)建自簽名證書界酒; - 證書名稱設(shè)置為
dlv-cert
(記住這個(gè)名字并鸵,后面會用到)完疫;身份類型選擇自簽名根證書
舀瓢;證書類型選擇代碼簽名
,最后在讓我覆蓋這些默認(rèn)值
處打上勾蚓聘,選擇繼續(xù)
腌乡; - 在接下來的窗口中把有效期改長一些,例如改成10年(3650天)或粮;
- 然后一直往后导饲,直到出現(xiàn)選擇
指定用于該證書的位置
捞高,選擇鑰匙串系統(tǒng)
氯材,然后選擇創(chuàng)建; - 這樣證書就創(chuàng)建好了硝岗。
1.2 第二部:后續(xù)操作
- 在
鑰匙串訪問
窗口左面選擇鑰匙串系統(tǒng)
氢哮;然后在右面選擇剛才創(chuàng)建的證書(按名字查找,例如dlv-cert)型檀; - 點(diǎn)鼠標(biāo)右鍵冗尤,選擇
顯示簡介
打開證書詳細(xì)信息窗口; - 在
信任
一欄中代碼簽名
處選擇始終信任
胀溺,這樣使用該證書進(jìn)行簽名操作的時(shí)候就不會彈出提示框詢問了裂七。 - 然后在窗口左面選擇
密鑰
,在右面根據(jù)名字選擇對應(yīng)的專用密鑰
仓坞,點(diǎn)擊鼠標(biāo)右鍵選擇顯示簡介
背零; - 在彈出的窗口中選擇
訪問控制
標(biāo)簽頁,然后選擇允許所有應(yīng)用程序訪問此項(xiàng)目
无埃,這樣進(jìn)行調(diào)試的時(shí)候就不需要每次輸入密碼了徙瓶。
1.3 說明
以上步驟請確認(rèn)執(zhí)行完畢,否則會出現(xiàn)諸如error: could not launch process: could not fork/exec
之類的錯(cuò)誤嫉称。
2. 安裝和簽名
證書搞定之后侦镇,其他操作就簡單了。按照下面命令操作即可织阅。
2.1 下載源碼
<figure class="highlight plain" style="display: block; margin: 20px 0px; overflow: auto; padding: 0px; font-size: 13px; color: rgb(77, 77, 76); background: rgb(247, 247, 247); line-height: 1.6; border-radius: 1px; font-family: Lato, "PingFang SC", "Microsoft YaHei", sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
|
<pre style="overflow: auto; font-family: consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace; font-size: 13px; margin: 0px; padding: 10px; color: rgb(134, 145, 148); background: rgb(239, 242, 243); line-height: 1.6; border: none; text-align: right;">1
2
</pre>
|
<pre style="overflow: auto; font-family: consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace; font-size: 13px; margin: 0px; padding: 10px; color: rgb(77, 77, 76); background: rgb(247, 247, 247); line-height: 1.6; border: none;">mkdir $GOPATH/src/github.com/derekparker && cd $GOPATH/src/github.com/derekparker
git clone https://github.com/derekparker/delve.git && cd delve
</pre>
|
</figure>
2.2 簽名安裝
<figure class="highlight plain" style="display: block; margin: 20px 0px; overflow: auto; padding: 0px; font-size: 13px; color: rgb(77, 77, 76); background: rgb(247, 247, 247); line-height: 1.6; border-radius: 1px; font-family: Lato, "PingFang SC", "Microsoft YaHei", sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
|
<pre style="overflow: auto; font-family: consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace; font-size: 13px; margin: 0px; padding: 10px; color: rgb(134, 145, 148); background: rgb(239, 242, 243); line-height: 1.6; border: none; text-align: right;">1
</pre>
|
<pre style="overflow: auto; font-family: consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace; font-size: 13px; margin: 0px; padding: 10px; color: rgb(77, 77, 76); background: rgb(247, 247, 247); line-height: 1.6; border: none;">CERT=dlv-cert make install
</pre>
|
</figure>
2.3 升級
升級時(shí)不需要重新生成證書壳繁,只需要更新源碼重新編譯簽名即可。