While we are here, may I ask another related question?
If I don't include Provisioning Profile into the app bundle (which contains Camera Extension inside), I get an error "Application can't be opened" when I try to launch the application under macOS 12.4. The crash report is generated, which contains the following basic information (may post a complete report if needed):
Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid))
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: CODESIGNING 1
Highlighted by Thread: 0
Backtrace not available
No thread state (register information) available
Binary Images:
Binary images description not available
Error Formulating Crash Report:
_dyld_process_info_create failed with 6
dyld_process_snapshot_get_shared_cache failed
Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯
thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port
EOF
However, if I put embedded.provisionprofile into the bundle or install it locally, the app is launched and Camera Extension is successfully installed.
So the question is why the provisioning profile is necessary here? Note that this is only for the application that contains and installs Camera Extension, otherwise it's not needed. Also is there any way to achieve the same without embedding the provisioning profile?