Permission denied portName:'com.apple.iphone.axserver' PID:***

1,517 阅读3分钟

Version信息

iOS:15.0
macOS:12.4 Montrey(M1)
Xcode:13.1(12A1030d)

完整的console log

2022-08-01 10:25:06.489208+0800 Driver[13569:2483700] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:13599 (
	0   AXRuntime                           0x00000001a8b8fc24 638F11FF-7696-30F3-A29E-8ECB6147567D + 322596
	1   AXRuntime                           0x00000001a8b455dc _AXGetPortFromCache + 708
	2   AXRuntime                           0x00000001a8b46cec AXUIElementPerformFencedActionWithValue + 488
	3   UIKit                               0x00000001f3b90c70 89D9DA59-C6CA-39FF-AF87-AB9019F15DC6 + 932976
	4   libdispatch.dylib                   0x0000000103b3ca20 _dispatch_call_block_and_release + 32
	5   libdispatch.dylib                   0x0000000103b3e700 _dispatch_client_callout + 20
	6   libdispatch.dylib                   0x0000000103b4683c _dispatch_lane_serial_drain + 952
	7   libdispatch.dylib                   0x0000000103b47558 _dispatch_lane_invoke + 428
	8   libdispatch.dylib                   0x0000000103b53fa0 _dispatch_workloop_worker_thread + 916
	9   libsystem_pthread.dylib             0x00000001f38711b0 _pthread_wqthread + 288
	10  libsystem_pthread.dylib             0x00000001f3870f50 start_wqthread + 8
)

操作过程上下文

1、WKWebView完成初次夹在加载
2、长按WKWebView中图片、链接,弹出SFSafariViewController -> SFBrowerRemoteViewController

//此时控制台log
2022-08-01 10:24:34.053043+0800 Driver[13569:2481108] [UICollectionViewRecursion] cv == 0x1109a1000 Disabling recursion trigger logging
2022-08-01 10:24:34.054274+0800 Driver[13569:2481108] [UICollectionViewRecursion] cv == 0x1109a1000 Disabling recursion trigger logging
2022-08-01 10:24:34.071736+0800 Driver[13569:2481108] [UICollectionViewRecursion] cv == 0x1109a1000 Disabling recursion trigger logging
2022-08-01 10:24:34.483873+0800 Driver[13569:2483343] [AXRuntimeCommon] Unknown client: Driver
2022-08-01 10:24:34.663736+0800 Driver[13569:2481108] [Accessibility] WKContentView[@] set up: @ pid: @ MACH_PORT 278130176
2022-08-01 10:24:34.664115+0800 Driver[13569:2481108] [Accessibility] WKContentView[@] set up: @ pid: @ MACH_PORT 278413312
2022-08-01 10:24:34.664298+0800 Driver[13569:2481108] [Accessibility] WKContentView[@] set up: @ pid: @ MACH_PORT 319205376

3、点击空白处,SFSafariViewController关闭,出现上述AXRuntimeCommon问题

解决方案

目前并没有解决这个问题,只能关闭长按弹出SFSafariViewController,一次性来绕过这个问题。这个问题曾经被Apple记录过,编号FB7513956,点此链接查看过程developer.apple.com/forums/thre…
我也在博客上找到了相关的言论:

最后,iOS 13.3 破坏了 Web 视图中的 UI 测试内容。不幸的是,SFSafariViewControllerASWebAuthenticationSession无障碍服务(这是 UI 测试与系统交互的方式)将其视为 Web 视图,因此自动化测试无法执行登录。该问题似乎源于无障碍服务被拒绝检查应用程序和/或系统进程的 Web 视图的能力,因此查询只是超时并未能通过 UI 测试。例如:“[AXRuntimeCommon] AX 查找问题 - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver'”。我将此记录为 FB7513956,并且此问题可能会在未来的操作系统版本(可能是下一个 iOS 13.3.1 测试版)中得到解决,因此希望我不必等待太久即可解决此问题。

此博主链接:msolarana.netlify.app/2020/01/20/…

但是我在iOS15上依然触发了这个问题,特此记录。

查找到的相关问题

stackoverflow.com/questions/6…

stackoverflow.com/questions/6…

github.com/TimOliver/T…

developer.apple.com/forums/thre…