该技能按症状组织 Core Location 排查流程,适合遇到定位更新不返回、后台定位中断、授权始终被拒、精度异常、地理围栏不触发或定位图标不消失时使用。
主要能力包括:给出各症状的快速检查与决策树,例如先查看 authorizationStatus(0=notDetermined,1=restricted,2=denied,3=authorizedAlways,4=authorizedWhenInUse)、locationServicesEnabled() 与 accuracyAuthorization;说明 Info.plist 中 NSLocationWhenInUseUsageDescription、NSLocationAlwaysAndWhenInUseUsageDescription 缺失会导致静默失败;讲解后台定位需在 Xcode 的 Background Modes 勾选 Location updates,并持有 CLBackgroundActivitySession;指出地理围栏数量上限 20、半径建议不小于 100 米,且必须持续 await monitor.events;定位图标不消失时需取消 Task、invalidate 会话、移除 CLMonitor 条件或停止旧版 CLLocationManager。
使用方式:按症状对照决策树逐项排查,必要时用 log stream --predicate 'subsystem == "com.apple.locationd"' --level debug 查看日志。
限制:部分能力依赖 iOS 17/18 及特定 API;未提供安装命令、收费与价格信息。