用于从 Apple 开发站点获取配置文件的 API

发布于 11-14 18:28 字数 119 浏览 2 评论 0原文

我想知道是否可以使用 API 从 Apple Developer Portal 获取最新的配置文件? 我已经为 iOS 项目设置了 CI,但每次更改配置文件时我都必须手动更新配置文件,因此我也很高兴能够自动化此过程。 谢谢

I'm wondering if it's possible to get the latest provisioning profile from Apple Developer Portal using API?
I've set up CI for iOS project but I have to update provisioning profile manually every time when it is changed so I'd be glad to automate this process as well.
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

浸婚纱2024-11-21 18:28:25

Spaceship 提供对开发者门户 API 的访问,无需进行网页抓取!

Spaceship provides access to he developer portal API, no web scraping!

不必你懂2024-11-21 18:28:25

使用 cupertino ruby​​ 脚本

有一个分支,因为门户更改后主分支尚未更新。

https://github.com/MatthewMaker/cupertino

Use cupertino ruby script

There is a branch instead as the main one has not been updated since the portal is changed.

https://github.com/MatthewMaker/cupertino

九局2024-11-21 18:28:25

恐怕不是。您应该能够通过抓取 HTML 来完成它,但仅此而已。苹果在网络方面表现很糟糕(客户端除外)。

I'm afraid not. You should be able to get it done by scraping the HTML, but that's about it. Apple are terrible when it comes to the web (client-side excepted).

找个人就嫁了吧2024-11-21 18:28:25

我想出了以下解决方案:

  • 创建一个特殊的存储库,其中最新的配置文件(我知道仍然存在人为因素,但目前我还没有找到更好的解决方案)

  • 在构建之前使用配置文件检查存储库并将其复制到/User/$USER/Library/Library/MobileDevice/Provisioning Profiles

  • grep 查找配置文件哈希并将该哈希作为构建选项传递(例如

xcodebuild -target ${TargetName} -sdk "${TARGET_SDK}" -configuration "Ad Hoc" "CODE_SIGN_IDENTITY[sdk=iphoneos*]=${PROFILE_NAME}" "PROVISIONING_PROFILE=${grep results}"

该解决方案对我有用,但仍然存在一些问题。

I came up with the following solution:

  • create a special repo which has only up to date profiles (I know there is still human factor but I have not found better solution at the moment)

  • checout the repo with profiles before a build and copy it to the /User/$USER/Library/Library/MobileDevice/Provisioning Profiles

  • grep to find a profile hash and pass the hash as a build option (e.g

xcodebuild -target ${TargetName} -sdk "${TARGET_SDK}" -configuration "Ad Hoc" "CODE_SIGN_IDENTITY[sdk=iphoneos*]=${PROFILE_NAME}" "PROVISIONING_PROFILE=${grep results}"

)

The solution works for me but still has some issues.

回心转意2024-11-21 18:28:25

我发现最简单的方法是使用 sigh ,它是 < a href="https://docs.fastlane.tools/" rel="nofollow noreferrer">fastlane。在 Mac 上,只需运行以下命令:

brew install fastlane
fastlane sigh download_all

这将为您的帐户下载所有配置文件。

您还可以通过传递捆绑 ID 来下载单个应用程序:

fastlane sigh -a com.my.app

如果它不存在,它将创建一个应用程序;如果它过期或无效,它将修复它。

如果您想在不输入用户名和密码的“交互”模式下执行此操作,只需将 FASTLANE_USERFASTLANE_PASSWORD 环境变量设置为您的 Apple 帐户电子邮件和密码(和 FASTLANE_TEAM_ID(如果您有多个团队)。

I've found the easiest way to do this is to use sigh which is part of fastlane. On Mac just run the following:

brew install fastlane
fastlane sigh download_all

This will download all of the profiles for your account.

You can also download an individual app by passing in a bundle ID:

fastlane sigh -a com.my.app

It will create one if it doesn't exist and will repair it if it's expired or invalid.

If you want to do this without the "interactive" mode of entering your username and password you can just set the FASTLANE_USER and FASTLANE_PASSWORD environment variables to your Apple account email and password (and FASTLANE_TEAM_ID if you have multiple teams).

七度光2024-11-21 18:28:25

对于任何希望使用 AppStoreConnect API

  1. 身份验证
  2. 下载配置文件的人 从门户网站获取配置文件 ID
  1. 获取个人资料信息(响应将为 json) - read_and_download_profile_information
  2. 从配置文件信息 json 中获取 [' 的值data']['attributes']['profileContent'] 键。这将是 base64 字符串,写入文件或变量。
  3. 解码 base64 字符串以创建配置文件。
  • shell - base64 --解码路径/到/文件> profile.mobileprovision
  • python - base64.b64decode(profile_content_string)

For anyone looking to download profiles using AppStoreConnect API

  1. Authenticate
  2. Get the profile id
  1. Get the profile information (response will be json) - read_and_download_profile_information
  2. From the profile information json, get the value for ['data']['attributes']['profileContent'] key. This would be base64 string, write to a file or variable.
  3. Decode base64 string to create the profile.
  • shell - base64 --decode path/to/file > profile.mobileprovision
  • python - base64.b64decode(profile_content_string)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文