macOS设备上Continuity/Handoff失效及iMessage激活失败的解决方案

前段时间我由于误操作搞坏了我的MacBook上的macOS系统,我重装系统后发现所有Continuity功能都无法使用了。

首先澄清一个概念,Continuity(连续互通)和Handoff(接力)经常被人们混淆。实际上Continuity是多个功能的组合,其中包括Handoff,智能热点,全局剪贴板,AppleWatch解锁等。具体请查看Apple官方支持网页。

使用“连续互通”连接 Mac、iPhone、iPad、iPod touch 和 Apple Watch – Apple 支持

问题

这个问题最明显的表现在于所有Continuity功能均无法使用。除此之外,iMessage和FaceTime均无法激活,登录时会提示“激活时出错,请再试一次。”

在同一Mac上更换其他AppleID也是一样的结果,然而该AppleID在iPhone和iPad上的上述功能均正常。

Analysis of Excessive Data Consumption and App Crashing on iOS Devices

点击这里前往中文版/Click here for Chinese version

This is the third knotty issue happened on my Apple devices.

By the end of June this year, my iPhone running iOS11.4 ran nearly 10G of mobile data during a single day. The log of Shadowrocket(An Network Extension app) revealed that my iPhone kept downloading unknown data from gateway.icloud.com at the rate of about 200kb/s. I tried switching the iCloud account, but the problem appeared again after a short period of time. I was busy dealing with the exams at that time, so I simply Rejected gateway.icloud.com in Shadowrocket. No negative influence on daily use.

After some searching, I found some people claimed they have encountered a similar problems (22nd floor): https://www.v2ex.com/t/459452 . However, his solution of logging out of iCloud on macOS devices was not successful for me.

But the trouble didn’t end. Since then, a large number of apps crashes while launching on my iPhone and iPad at a frequency of 2-3 times a week. When the problem occurs, most applications will hang at the Splash Screen and crash after about 10 seconds. Applications that crashed including TIM, Notability and all of the Google apps. WeChat and Apple’s own applications are unaffected. During this time, the phone went hot, and will stuck when entering the iCloud settings. My iPhone runs iOS 11.4 and 12 Public Beta, and iPad running 11.4 and 12 Developer Beta.

Attempts

I tried rebooting, force rebooting, reinstalling affected apps, upgrading iOS, logging out and logging back in to iCloud, didn’t work. A temporary solution is turning the iCloud Drive switch off and on, which has a chance to temporarily fix the problem. However, entering the iCloud settings at this time has a high probability of being stuck, so you need to try several times. The iPhone will recover from the problem after a while even if not doing anything.

iOS异常流量消耗及大范围应用闪退问题的分析

Click here for English version/点击这里前往英文版

这是我遇见的第三个Apple设备上的疑难杂症。

大概是今年的6月底,我的iPhone(运行iOS11.4)一夜之间跑掉了将近10个G流量。经检查Shadowrocket日志发现,iPhone在以约200kb/s的速度持续从 gateway.icloud.com下载不明数据。(根据其他受害者反映,如果没有安装Surge一类的软件,这些不明流量会在流量统计中显示为“文稿与同步”)我原来的iCloud使用的是日区账号,换成国区账号之后好了一段时间(一天多一点)之后,问题再次出现。由于我当时正被考试周搞得焦头烂额,将 gateway.icloud.comReject掉之后就没有再管他,也不影响日常使用。

之后查找相关资料发现,也有网友遇到类似问题(22楼):https://www.v2ex.com/t/459452。但是他提出的登出macOS设备上的iCloud的方案,我试了之后并没有成功。

但是事情并没有结束,从那之后没多久,我的iPhone和iPad都出现了时不时发生应用大面积闪退的问题,频率基本维持在一周2-3次。当问题发生时,点开大多数应用都会卡在Splash Screen大约10秒后闪退。会闪退的应用包括但不限于知乎,TIM,Notability及所有Google应用。微信和苹果自带应用基本不受影响。此时手机会发热,并且进入iCloud界面时大概率会卡死。出现问题时我的iPhone运行的iOS版本为11.4,后来升级至iOS 12 Public Beta后问题依然存在。

尝试

我尝试了重启,强行重启,重新安装出现问题的应用,升级iOS及登出并重新登录iCloud,均没有效果。临时的处理方法是关闭并打开iCloud Drive开关,有一定几率暂时修复这个问题。但是此时进入iCloud界面有大概率会卡死,所以需要多试几次才行。(事后证实这个问题与iCloud Drive无关,可能只是巧合)如果不进行任何处理,一段时间以后也会自行恢复。

分析

由于这个问题十分隐蔽,导致每个人的描述都不太一样,因而很难在网上搜索到。我整理了所有出现类似问题的贴子合集:
https://www.v2ex.com/t/460089
https://www.v2ex.com/t/471491
https://cn0xroot.com/2018/07/17/2018-07-16/
https://www.v2ex.com/t/459452
https://discussionschinese.apple.com/thread/140132632
https://www.reddit.com/r/jailbreak/comments/8sf4u3/help_this_block_of_text_is_being_spammed_in_my/
https://forums.developer.apple.com/thread/105722
https://forums.macrumors.com/threads/excessive-data-consumption-for-documents-sync-and-constantly-high-cpu-load-on-iphone-and-ipad.2127349/

这个问题出现的时间很随机,我目前还没有找到其触发条件,难以手动复现。我初步定位问题与iCloud有关。至于此前曾经出现过的iCloud持续下载数据问题,我猜测两者之间也有关联。

检查Console发现,在应用启动并闪退时,会出现 Provision violated for watchdog scene-create信息。经搜索得知,这个报错是由于应用启动时间过长而被系统强行杀死。