[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fsvESbzT51AskEnU1fqyhSCAChon4PtlxHpw9KliOGSs":3},{"code":4,"message":5,"data":6},200,"成功",{"id":7,"createdAt":8,"title":9,"content":10,"summary":11,"image":12,"uid":13,"user":14,"categoryId":21,"category":22,"subCategoryId":24,"subCategory":25,"comments":27,"status":17,"reason":28,"notice":28,"visitCount":29,"commentCount":30,"keywords":31},9,"2024-01-10T13:39:17.341Z","fastlane: No code signing identity found and can not create a new one","### 问题\nNo code signing identity found and can not create a new one because you enabled `readonly`\n\n### 背景：\n在iOS的app的持续构建中使用了fastlane来管理证书，并且配置脚本命令上传Testflight、Appstore。\n在打包过程中，fastlane报了如下截图中错误.\n\n截图：\n![](https://image.xinwei.ltd/image_11704893729190.png)\n\n\n### 分析问题步骤：\n1. 在打包机上通过Xcode检查签名配置（或者在钥匙串中查看本地证书是否都有效）。\n首先在执行打包的电脑机器上，通过Xcode打开打包的工程，查看对应iOS target的下的签名配置Signing & Capabilities，检查Debug and Profile、Adhoc、Release环境下，选择的profile证书是否匹配（若不匹配，profile下拉选择框下会有黄色三角）。\n![](https://image.xinwei.ltd/image_21704893844998.png)\n\n2. 检查target下的build settings中的signing配置。\n![](https://image.xinwei.ltd/image_31704893867481.png)\n\n确保Adhoc、Debug、Profile、Release对应的配置正确。\n3. 问题定位。\n第2步中的很好确定，很可能出现问题的就是第1步中的配置。\n一般在cer证书没有问题的情况下，出现本文中问题的情况，都是由于profile文件和cer不匹配导致的，我的情况就是如问题截图中一样的。\n导致不匹配的一个原因是：打包机上下载的profile，这个profile中的Certificates选择不正确，这是因为原先iOS项目中已经有一个发布证书，但是我用fastlane match重新生成了一个证书，但是fastlane match在生成profile文件时，使用了原先的发布证书。而我打包机上的发布证书，只有fastlane match生成的那个。\n4. 总结\n发布证书有2个，只有1个是fastlane match通过Apple的API生成的。但是fastlane match命令生成的profile使用的是之前的发布证书。\n\n### 解决办法：\n#### 方法一：\n登录Apple certificate证书中心，在profile下，找到在步骤1所示的黄色警告⚠️的profile文件，进入profile详情，点击Edit，确保Certificates选择的是打包机钥匙串中最新的那个发布证书。保存修改后，download这个profile到本地，并双击安装这个profile。\n#### 方法二：\n（比较有风险，风险点就是需要删除所有的发布证书。如果之前的发布证书或者其p12证书，被使用在其他第三方的平台，则需要更新其他平台上使用的这个证书）使用fastlane match nuke删除所有的证书和profile（或者fastlane match nuke distribution删除发布相关的证书），切记尤其删除了推送证书，那么需要及时更新所有的其他推送平台上的证书。\n","问题 No code signing identity found and can not create a new one because you enabled readonly 背景： 在iOS的app的持续构建中使用了fastlane来管理证书，并且配置脚本命令上传Testflight、Appstore。 在打包过程中，fastlane报了如下截图中错误. 截图： (https://ima","https://image.xinwei.ltd/image_11704893729190.png",499668042977349,{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":19,"createdAt":20},"13121171998","全栈老韩",1,"https://image.xinwei.ltd/images/IMG_5430.JPG","全栈工程师，擅长iOS App开发、前端（vue、react、nuxt、小程序&Taro）开发、Flutter、React Native、后端（midwayjs、golang、express、koa）开发、docker容器、seo优化等。","2024-01-01T16:14:30.305Z",2,{"id":21,"name":23},"IT技术",3,{"id":24,"name":26,"parentId":21},"iOS",[],"",330,0,"fastlane,no code signing identitiy,code sign"]