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
相关推荐
栒U2 小时前
一文从零部署vLLM+qwen0.5b(mac本地版,不可以实操GPU单元)
人工智能·macos·vllm
Swift社区5 小时前
在企业内部分发 iOS App 时如何生成并使用 manifest.plist
macos·ios·cocoa
他们都不看好你,偏偏你最不争气9 小时前
【iOS】 单例模式
macos·objective-c·cocoa
FreeBuf_16 小时前
苹果用户速更新!macOS存严重漏洞,用户隐私数据面临泄露风险
macos
Thomas214316 小时前
macos deepctr_torch虚拟环境配置
macos
wxl78122716 小时前
MacOS 运行CosyVoice
macos·cosyvoice·语音自然
lichong95117 小时前
【混合开发】vue+Android、iPhone、鸿蒙、win、macOS、Linux之video 的各种状态和生命周期调用说明
android·vue.js·macos
程序务虚论17 小时前
mac M1上安装windows虚拟机报错
windows·macos·parallels
今天头发还在吗20 小时前
【Go】:mac 环境下GoFrame安装开发工具 gf-cli——gf_darwin_arm64
macos·golang·go·gf-cli
小妖6661 天前
MAC在home下新建文件夹报错“mkdir: test: Operation not supported”
macos