You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:Xcode 14中缺失WatchKit Extension无法使用WatchConnectivity

关于WatchConnectivity缺少WatchKit Extension无法使用的问题

WatchConnectivity 是苹果专为 iPhone 与 Apple Watch 通信设计的框架,必须搭配WatchKit Extension才能正常工作——这是框架的硬性限制,没有Extension的前提下完全无法启用该功能。

解决的唯一可行方案就是为你的iOS项目添加WatchKit Extension:

  • 打开Xcode,在当前项目中选择 File > New > Target,找到Watch App for iOS App模板,跟随向导完成WatchKit Extension及配套Watch App的创建。
  • 创建完成后,完成两端配置校验:
    1. 在iOS主App的Info.plist中添加WKAppBundleIdentifier,值对应Watch App的Bundle ID。
    2. 在WatchKit Extension的Info.plist中添加WKCompanionAppBundleIdentifier,值对应iOS主App的Bundle ID。
    3. 在iOS主App和WatchKit Extension的代码中分别初始化并激活WCSession,确保两端会话能正常建立配对。
  • 额外注意:添加Extension后需同步签名配置,主App与Extension必须使用同一开发者Team;若需要跨端共享数据,还需开启对应的App Groups权限。

内容的提问来源于stack exchange,提问作者ChickenRei

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 19:39:55