跳到正文
Google Ads Developer Blog· Google Ads Developer Advisor·· 5 天前精选AI 评分75

应对 CocoaPods 只读模式:Google 宣布 iOS 端移动广告 SDK 将迁移至 Swift Package Manager

Prepare for CocoaPods read-only mode: Migrate your iOS apps to Swift Package Manager

AI 导读

Google 宣布因 CocoaPods Specs 仓库将于 2026 年 12 月 2 日转为只读模式,届时将停止在 CocoaPods 发布 iOS 版 Google Mobile Ads SDK 及中介适配器的新版本。

推荐理由

明确了现有构建不受影响但后续更新仅限 SPM,方便开发者提前评估工程依赖改造排期。

正文 · 原文

On December 2, 2026, the CocoaPods Specs repository will permanently transition to read-only mode. As a result, we will no longer publish new versions of the Google Mobile Ads SDK or mediation adapters for iOS to CocoaPods after this date.

What this means for your iOS apps

If you currently use CocoaPods to install the Google Mobile Ads SDK (Google-Mobile-Ads-SDK) or User Messaging Platform SDK (GoogleUserMessagingPlatform), keep the following in mind:

  • Existing builds are not affected: All previously published versions of the Google Mobile Ads SDK and mediation adapters on CocoaPods will remain available in the read-only specs repository.
  • No future updates on CocoaPods: After December 2, 2026, new SDK releases, features, and bug fixes will only be distributed through Swift Package Manager and manual downloads.

Migrate to Swift Package Manager

To keep receiving the latest Google Mobile Ads SDK updates, we recommend migrating your iOS projects to Swift Package Manager (SPM). SPM is Apple's first-party dependency manager built directly into Xcode.

To switch your project to Swift Package Manager, follow these steps:

  1. If you are removing CocoaPods from your project completely, run pod deintegrate in your project directory.
  2. In Xcode, navigate to File > Add Package Dependencies....
  3. In the search bar, enter the Google Mobile Ads Swift Package GitHub repository URL: https://github.com/googleads/swift-package-manager-google-mobile-ads.git
  4. Select the version rule you want to use. We recommend Up to Next Major Version.
  5. Add the package to your target.

For full setup instructions, including how to download the frameworks manually, see the Get Started guides for AdMob and Ad Manager. If you use mediation, you can migrate your adapters the same way. Google Mobile Ads mediation adapters support Swift Package Manager, and you can find each adapter's package URL in our mediation documentation.

If you have any questions or want to discuss this post, please reach out to us on our “Google Advertising and Measurement Community” Discord server.

 - Justin Malandruccolo, Mobile Ads Developer Relations

来源:Google Ads Developer Blog · ads-developers.googleblog.com