15

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?

pkamb
  • 33,281
  • 23
  • 160
  • 191
Vineet Choudhary
  • 7,433
  • 4
  • 45
  • 72

3 Answers3

24

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.

Vineet Choudhary
  • 7,433
  • 4
  • 45
  • 72
  • 2
    Mine is enabled but still getting the same error. This is ridiculous. – ninjaneer Nov 02 '18 at 18:30
  • 3
    This worked for me, but in an application containing sub-applications (e.g. an app set to auto-run at login set up as per Tim Schroeder's famous article, https://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/), I needed to set ALL applications in the workspace to have Hardened Runtime enabled. With only the main application enabled, the error would still occur. – Jon Schneider Apr 21 '19 at 19:51
8

It is also available in Capabilities section

Hardened Runtime in Capabilities section

Vincenso
  • 516
  • 4
  • 8
5
  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>"
    
Dmitry
  • 51
  • 1
  • 1