Hey 👋
I have an extension of type "Device Activity Report Extension".
Is there a way to know from the parent app if the extension process is alive?
the process name is DeviceActivityReportService
Why would I like to detect that?
The extension sometimes crashes due to memory pressure and I would like to reload the view automatically when this happens.
This issue happens under normal app use — the user switches quickly between two tabs that have DeviceActivityReport
.
I filed a bug for this with a sample project to replicate (12192929)
Here is an output from the Console app when the DeviceActivityReportService
is killed and the UI disappears:
kernel memorystatus: killing process 33061 [DeviceActivityReportService] in high band FOREGROUND (100) - memorystatus_available_pages: 68660
kernel DeviceActivityReportService[33061] Corpse allowed 1 of 5
SpringBoard [xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061] Workspace connection invalidated.
SpringBoard [xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061] Now flagged as pending exit for reason: workspace client connection invalidated
SpringBoard [FBInterfaceOrientationServiceServer] Removing client xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061.
SpringBoard Removed client for observing orientation events: <FBServiceFacilityServerClientHandle: 0x281fa23a0; com.apple.frontboardservices.orientation-observer; xpcservice<com.apple.DeviceActivityUI.DeviceActivityReportService([application<com.labalab.Screen-Time.marcin>:33046])>:33061: remote>
kernel 266908.072 memorystatus: killing_specific_process pid 33061 [DeviceActivityReportService] (per-process-limit 100) 35873KB - memorystatus_available_pages: 68793
Screen Time Terminating interface and invalidating assertion: identifier: com.apple.DeviceActivityUI.DeviceActivityReportService; assertion: 0x282316b70
Screen Time Terminating interface and invalidating connection: identifier: com.apple.DeviceActivityUI.DeviceActivityReportService; assertion: 0x0