美文网首页
2018-05-08

2018-05-08

作者: 如风云淡 | 来源:发表于2018-05-08 10:35 被阅读0次

1. 签名证书准备

1.1 第一步:创建证书

  • 打开钥匙串访问
  • 菜单栏中选择钥匙串访问-证书助理-创建证书开始创建自签名证书;
  • 证书名称设置为dlv-cert(记住这个名字,后面会用到);身份类型选择自签名根证书;证书类型选择代码签名,最后在让我覆盖这些默认值处打上勾,选择继续
  • 在接下来的窗口中把有效期改长一些,例如改成10年(3650天);
  • 然后一直往后,直到出现选择指定用于该证书的位置,选择钥匙串系统,然后选择创建;
  • 这样证书就创建好了。

1.2 第二部:后续操作

  • 钥匙串访问窗口左面选择钥匙串系统;然后在右面选择刚才创建的证书(按名字查找,例如dlv-cert);
  • 点鼠标右键,选择显示简介打开证书详细信息窗口;
  • 信任一栏中代码签名处选择始终信任,这样使用该证书进行签名操作的时候就不会弹出提示框询问了。
  • 然后在窗口左面选择密钥,在右面根据名字选择对应的专用密钥,点击鼠标右键选择显示简介
  • 在弹出的窗口中选择访问控制标签页,然后选择允许所有应用程序访问此项目,这样进行调试的时候就不需要每次输入密码了。

1.3 说明

以上步骤请确认执行完毕,否则会出现诸如error: could not launch process: could not fork/exec之类的错误。

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 升级

升级时不需要重新生成证书,只需要更新源码重新编译签名即可。

参考文章:安装Go语言调试工具dlv

相关文章

网友评论

      本文标题:2018-05-08

      本文链接:https://www.haomeiwen.com/subject/lfeirftx.html