Cannot lauch Share Extension from Photos

I am encountering an issue where the Share Extension in my app fails to launch intermittently.

In my project, NSExtensionPrincipalClass is set to ComposeShellVC. When the Share Extension launches successfully, the following log entry appears, indicating that ComposeShellVC is being created:

09:21:09.339190+0800    2254529 ViewServices    com.apple.UIKit compose-shareextension  
Received request to create view controller: self: <_UIViewServiceViewControllerOperator: 0x109194c00>;  
class: compose_shareextension.ComposeShellVC; contextToken: 42EA1BDB-5CDF-4EBD-8503-8A9A04BCE41C

However, when the bug happens, this entry is absent during the failed launches. Additionally, I am unable to set breakpoints within the Share Extension to further investigate. Could you provide guidance on the next steps to diagnose this issue? Any advice on debugging techniques or tools that can help pinpoint the cause of this behavior would be greatly appreciated.

You should be able to attach to the process where you are invoking your Share Extension. You can do this by selecting your extension target and tapping run. This will bring up a list of apps to run with your extension. Once running, Xcode should pause on your code breakpoints.

Rico


WWDR | DTS | Software Engineer

I am following the process that selecting extension target and run from Photos/Safari. But the process seems never launched.

Once running, Xcode should pause on your code breakpoints

Should I set breakpoint in the init method of NSExtensionPrincipalClass?

Cannot lauch Share Extension from Photos
 
 
Q