Xcode - 强化运行时未启用

Xcode - Hardened Runtime is not enabled

我正在尝试使用 Xcode 10 GM 将我的应用程序提交给 Apple 进行公证。但是我收到这个错误 -

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.

我试图在工作区和构建设置中找到它,但没有成功。

如何为这个 Xcode 项目启用强化运行时?

好的,我找到了答案。在 All 构建设置部分的 Build Settings 选项卡中提供强化的运行时设置。

此外,如果您的应用程序包含多个目标,那么您需要为所有目标启用强化运行时。

它也可以在功能部分使用

  1. Signing & Capabilities 屏幕上启用 Hardened Runtime 以覆盖应用程序和框架。
  2. Build Settings 屏幕上将 --deep 标志添加到 Signing - Other Code Signing Flags 以覆盖框架内的直接嵌套应用程序。
  3. Build Phases屏幕上添加一个新的运行脚本阶段以覆盖框架内的间接嵌套应用程序:

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