xcode不同账号使用相同的bundle identifier

由于项目的风险隔离需要,需要用公司账号和个人账号分别打包一个ipa 包并导出,过程中遇到了很多问题,记录一下。

首先是不确定bundle identifier是全局唯一还是账号内唯一。问了下ChatGPT:

Bundle Identifier的唯一性是在开发团队范围内进行检查的,而不是全局唯一。这意味着,如果您在不同的开发团队或开发者账户中使用相同的Bundle Identifier,通常是允许的。

虽然是允许不同账号使用相同的bundle identifier,但我切换后仍然报错了:

Failed to register bundle identifier. The app identifier "com.imeikan.app" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again.

这个报错很迷惑,看字面意思就是不支持使用相同的bundle identifier,要不是身边别的朋友能成功,我肯定放弃了。

查了很久资料,找到一个stackoverflow 的回答,操作之后终于成功了

  1. cd ~/Library/MobileDevice/Provisioning\ Profiles
  2. rm *
  3. Xcode > Preferences… > Accounts > click your Account and Team name > click Download Manual Profiles
  4. Run app again

当然,后面还有一些报错,根据提示可以很快修复,例如先删除Entitlements 等。

Leave a Comment

邮箱地址不会被公开。 必填项已用*标注