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
相关推荐
2501_9159214314 小时前
iOS开发环境搭建详解 Xcode 配置与快蝎轻量级工具选择
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
JoyCong199817 小时前
为什么连接到被控后,客户端会自动锁定+出现锁屏界面?
macos·智能手机·电脑·远程工作·远程操作
芳草萋萋鹦鹉洲哦21 小时前
【git】重新生成并添加 SSH Key(Mac)
git·macos·ssh
2501_915918412 天前
详解iOS App上架至App Store的全流程步骤与注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
库奇噜啦呼2 天前
【iOS】weak底层实现
macos·ios·cocoa
2601_961593422 天前
视频分辨率太低?Topaz Video AI v1.6.0 让画质跃升
人工智能·macos·音视频
17715574312 天前
Mac 上 Ruby、gem、rvm、CocoaPods 四者关系通俗讲清楚
macos·ruby·cocoapods
Shell运维手记2 天前
交换机(二层交换机)完整工作原理
运维·网络·网络协议·macos·交换机
寒水馨2 天前
macOS下载、安装 Tailwind CSS-v4.3.3(附安装包tailwindcss-macos-arm64)
前端·css·macos·tailwind css·utility-first·css 框架·实用优先
寒水馨2 天前
macOS下载、安装neovim-v0.12.4(附安装包nvim-macos-arm64.tar.gz)
macos·vim·lua·文本编辑器·终端·lsp·neovim