Xcode - Hardened Runtime is not enabled

Viewed 6915

I'm trying to submit my app to Apple for notarized using Xcode 10 GM. But I'm getting this error -

Hardened Runtime is not enabled.

"AppBox.app" must be rebuilt with support for the Hardened Runtime. Enable the Hardened Runtime capability in the project editor, then test your app, rebuild your archive, and upload again.

enter image description here

I've tried to find this in the Workspace and Build Settings, but no success.

enter image description here

How can I enable Hardened Runtime for this Xcode project?

3 Answers

Ok, I found the answer. Hardened Runtime setting available in the Build Settings tab in All build setting section.

enter image description here

Also, If your application containing multiple targets then you need to enable Hardened Runtime for all targets.

It is also available in Capabilities section

Hardened Runtime in Capabilities section

  1. Enable Hardened Runtime on the Signing & Capabilities screen to cover the app and frameworks.
  2. Add --deep flag to Signing - Other Code Signing Flags on the Build Settings screen to cover the direct nested applications inside the frameworks.
  3. Add a new run script phase on the Build Phases screen to cover the indirect nested applications inside the frameworks:

    codesign --force --options=runtime \
    --sign "${EXPANDED_CODE_SIGN_IDENTITY_NAME}" \
    "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Contents/Frameworks/<PATH_TO_THE_APPLICATION>"
    
Related