Whenever I build my Xcode project, after compiling all my code, it takes forever to finish "signing product." (I believe it's because the project includes about 200 MB of resources that need signing.) I would like to skip the code signing during development, so the build can finish faster. How can I do this?
-
2in build settings, choose not code sign. Will this help?– WingzeroJun 25, 2015 at 1:33
-
Somehow, it doesn't help. This was a problem before I had a valid code signing certificate.– tbodtJun 25, 2015 at 19:32
-
Is this for iOS or Mac?– Joshua NozziAug 12, 2015 at 10:48
-
Can you check this one stackoverflow.com/q/26822962/767329– Mihriban MinazAug 12, 2015 at 13:43
-
@JoshuaNozzi Mac, but it shouldn't matter– tbodtAug 12, 2015 at 16:55
5 Answers
As of Xcode 10, here is how to turn off code signing for a macOS app:
- Select your project in the project navigator.
- Select your app in the list of targets.
- Click “Build Settings”.
- Click “All”.
- Click “Levels”.
- Type “identity” into the search field.
- Click on the Code Signing Identity row, under the column for your app target (labeled “test” in my example). That cell of the table might appear empty.
- In the pop-up menu that appears, choose “Other…”.
- In the popover text box that appears, delete all text so the box is empty.
- Press return to dismiss the popover.
With this setting, Xcode will not sign your app target.
-
2This doesn't seem to work for building my iOS app. Is there anything specific to building macOS that makes this work vs. iOS? Jan 24, 2019 at 19:02
-
4iOS only allows signed apps. macOS allows both signed and unsigned apps. Please note that the question is tagged macos. Jan 24, 2019 at 19:26
-
1After following the instructions above, I had to close and reopen the project for XCode to build successfully. Dec 9, 2019 at 3:12
-
1
-
6I am getting error
An empty identity is not valid when signing a binary for the product type 'Application'
, any update ? Oct 10, 2020 at 11:00
To turn the code signing off, go to your project and target "Build Settings", search for "Code Signing Identity" change its value to "Don't Code Sign" in both of them.
To make this effective you need to change this value in the Project and all of the Targets separately.
-
Hmm...I don't know if I tried changing it in all the targets and the project.– tbodtAug 13, 2015 at 12:41
-
1I can't speak to older versions of XCode, but in 9.2+, under Build Setting, you have to check the "All" tab to see the "Code Signing Identity" option. Mar 25, 2018 at 13:39
-
7This solution is out dated. There is no option "Don't Code Sign" and there is only one "Code Signing Identity" (answer suggests two when it says "both of them"). I'm using Xcode 10.– JasonNov 25, 2018 at 15:22
-
4Xcode 10 only offers "Sign to Run Locally (Ad Hoc Code Sign)" now, which has sucked the last bit of fun (quick builds) out of mac programming. Dec 17, 2018 at 9:07
-
26In Xcode 10, you can choose “Other…” and set the text to empty to disable code signing. See this answer. Jan 21, 2019 at 18:40
If someone uses CMake
(for multi-platform projects) to disable code signing for specific target I used this:
set_target_properties(MyAppTarget PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
OUTPUT_NAME "My nice application name"
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME "My nice application name"
MACOSX_BUNDLE_INFO_PLIST path/to/Info.plist
MACOSX_BUNDLE_BUNDLE_VERSION ${MY_APP_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING "My nice application name v${MY_APP_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${MY_APP_VERSION}"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.my.app"
MACOSX_BUNDLE_COPYRIGHT "(C) 2019 My Company"
MACOSX_RPATH TRUE
MACOSX_FRAMEWORK_IDENTIFIER com.myapp.bundle.id
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@loader_path/Libraries"
RESOURCE "${RESOURCE_FILES}"
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE
XCODE_ATTRIBUTE_EXECUTABLE_NAME "exec_name"
)
-
1Thanks! As I understand, the only mandatory thing here to disable signing here is assigning empty string to
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
Dec 13, 2019 at 10:46 -
1I still see the command
/usr/bin/codesign --force --sign - --timestamp=none <ProjectName>
in CMake Post Build Rules. Any idea?– RoyiJun 5, 2020 at 17:44 -
1
-
@Royi, perhaps do you know if I can disable code signing from xcodebuild command ?– Zohar81Feb 9, 2022 at 11:38
You might try moving your resources to a separate bundle target, then adding the .bundle product of that target to your app’s “copy bundle resources” build phase — ideally the app build should then be able to use the bundle’s signature (which will only need to be regenerated when the bundle’s contents change) instead of having to re-sign the resources individually.
-
Would this mean there would be a
.bundle
in my Resource folder that all my stuff would be inside of?– tbodtAug 12, 2015 at 22:42 -
Well, just creating a folder with the .bundle extension won’t cause it to get signed. You need to create an actual bundle target alongside your application target. Select your project in the left pane, then click the + button at the bottom of the “PROJECT” / “TARGETS” list; the Bundle target type is in the “Framework & Library” section of the resulting window. From there, select the Build Phases tab of the bundle target, add all your resources to its Copy Bundle Resources section, then remove all of them from the application target’s. Aug 13, 2015 at 5:04
-
FWIW for iOS builds that you build into your simulator, you don't need code-signing. Hence no need to skip it.
You only need code-signing/Provisioning Profile on physical devices. I'm not aware of how you can skip them.
This other answer that I have not tried suggest that you can build without code-signing if you jailbreak but I'm not sure if it's answer is valid now