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_916007473 小时前
iOS 上架技术支持全流程解析,从签名配置到使用 开心上架 的实战经验分享
android·macos·ios·小程序·uni-app·cocoa·iphone
QMY5205203 小时前
深度优先遍历策略
macos·jupyter·postman
2501_9160074718 小时前
提升 iOS 26 系统流畅度的实战指南,多工具组合监控
android·macos·ios·小程序·uni-app·cocoa·iphone
wangxiaosu19 小时前
macos安装、更新、使用homebrew
macos·homebrew
心灵宝贝20 小时前
Mac版PDF Squeezer v4.5.1安装教程(DMG文件下载+详细步骤)
macos
前端架构师-老李1 天前
Java开发—JDK的安装和版本管理(macOS)
java·开发语言·macos
Digitally1 天前
如何将 Android 联系人备份到 Mac 的 4 种简单
android·macos
一勺菠萝丶1 天前
在 macOS 上用 Docker 为 Java 后端 & 常见开发需求搭建完整服务(详尽教程)
java·macos·docker
猿小猴子2 天前
在 MacOS Tahoe 上使用VMware虚拟机安装 ARM版 Windows11
macos·vmware·win11 for arm
feiyangqingyun2 天前
Qt项目作品在苹果macos上编译运行效果/视频监控系统/物联网平台等
开发语言·qt·macos