openAppWhenRun makes AppIntent crash when launched from Control Center.

Adding the openAppWhenRun property to an AppIntent for a ControlWidgetButton causes the following error when the control is tapped in Control Center:

Unknown NSError The operation couldn’t be completed. (LNActionExecutorErrorDomain error 2018.)

Here’s the full ControlWidget and AppIntent code that causes the errorerror:

Should controls be able to open apps after the AppIntent runs, or is this a bug?

Answered by daviorze in 794663022

I found the solution.

The control file must have the Target Membership with the App and Widget Targets to work.

You can't create the control only linked to the Widget extension.

Something like this image.

Same problem here!

+1

Accepted Answer

I found the solution.

The control file must have the Target Membership with the App and Widget Targets to work.

You can't create the control only linked to the Widget extension.

Something like this image.

How do you get Xcode to debug your Control Center widget? I found this thread after getting this error message out of Console.app streaming logs from my device.

[@Mr. Jefferson](https://developer.apple.com/forums/profile/Mr. Jefferson) instead of running your Runner(Main application), try running your WidgetExtension scheme. This will allow you to view debug logs from you Control Center Widget Buttons.

openAppWhenRun makes AppIntent crash when launched from Control Center.
 
 
Q