Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable hardened runtime to an app without migrating to Xcode 10?

I want to notarize my app and while notarizing I have received package invalid status for this "message": "The executable does not have the hardened runtime enabled.",

I am building the application in highsierra and Xcode 9.4.

I tried adding --options=runtime while code signing, but did not help to resolve the error.

like image 700
Sushma Avatar asked Oct 17 '25 22:10

Sushma


2 Answers

Use codesign. It has a --options=runtime flag.

https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution/resolving_common_notarization_issues

like image 67
seph Avatar answered Oct 20 '25 14:10

seph


the codesign option runtime means "make the signature compliant with a binary built withe hardened runtime". But your error message means that the binary was built without the hardened runtime enabled. Building code and signing it are two different things - you can't retroactively build when signing. You need to either use the + button on the left of the Signing & Capabilities tab to add the Hardened Runtime option, or if you're doing everything manually, go into the build settings and set ENABLE_HARDENED_RUNTIME to YES. When you verify the signature of your app, using:

codesign --display --verbose <path-to-app>

Look for the line beginning "codedirectory" and ensure that one of the flags listed is "runtime".

like image 45
user14357683 Avatar answered Oct 20 '25 13:10

user14357683



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!