macos Apple开发证书 应用签名p12证书 获取生成方法 codesign 证书获取

在开发macos应用的时候必须要对自己开发的应用进行签名才能使用, 下面介绍个人如何获取Apple开发签名证书.

必备条件, 你需要先安装 xcode , 注册一个苹果开发者账号 免费的就可以, 以下为获取流程

  1. You need to create a cert through xcode. Additionally, you need to have an apple developer account:
    1. go to Sign In - Apple and make sure you have accepted the terms.
    2. install xcode through the app store. Open it.
    3. On the accounts tab, add your apple id. Select it.
    4. Select Manage Certificates.
    5. Add whatever cert you are using. I am using a free account, so I did "Mac Development" Take note of the cert name.

打开xcode->preference

从xcode中获取并添加开发证书

接下来打开 钥匙串访问 即可导出p12证书

选择证书后导出即可获取 p12格式的apple 开发证书 myAppleDev.p12

myAppleDev.p12 开发证书全局配置

将下面的内容添加到 ~/.bash_profile文件中

复制代码
# 导出的p12密钥保存的位置
export CSC_LINK=$HOME/myAppleDev.p12
# p12密钥导出时设置的密钥密码
export CSC_KEY_PASSWORD=xxxx

使配置生效

bash 复制代码
# 使设置生效
source ~/.bash_profile

codesign使用签名

bash 复制代码
codesign --deep --force --verbose --sign "Mac Developer: MY NAME (MY CODE)" node_modules/electron/dist/Electron.app
相关推荐
Fine姐17 小时前
传感器WSNs TheDataLinkLayer——X-MAC
macos
初级代码游戏1 天前
Maui劝退:用windows直接真机调试iOS,无须和Mac配对
macos·ios·配置·maui·热重载
草巾冒小子2 天前
Mac如何连接惠普M126a打印机(教程篇)
macos
蒙小萌19932 天前
苹果UI 设计
macos·ui·cocoa
用户49055816081252 天前
Homebrew 简介
macos
可曾去过倒悬山2 天前
mac电脑的usr/libexec目录是干什么的?
macos
罗技1232 天前
高版本的MacOS如何降级?
macos
咕噜签名分发冰淇淋2 天前
申请注册苹果iOS企业级开发者证书需要公司拥有什么规模条件
macos·ios·cocoa
尽兴-3 天前
如何将多个.sql文件合并成一个:Windows和Linux/Mac详细指南
linux·数据库·windows·sql·macos
诗句藏于尽头3 天前
Mac关闭触控板
macos