61

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?

mfaani
  • 33,269
  • 19
  • 164
  • 293
tbodt
  • 16,609
  • 6
  • 58
  • 83

5 Answers5

109

As of Xcode 10, here is how to turn off code signing for a macOS app:

  1. Select your project in the project navigator.
  2. Select your app in the list of targets.
  3. Click “Build Settings”.
  4. Click “All”.
  5. Click “Levels”.
  6. Type “identity” into the search field.

first six steps

  1. 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.

where to click for step 7

  1. In the pop-up menu that appears, choose “Other…”.

pop-up menu

  1. In the popover text box that appears, delete all text so the box is empty.

empty popover

  1. Press return to dismiss the popover.

With this setting, Xcode will not sign your app target.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • 2
    This doesn't seem to work for building my iOS app. Is there anything specific to building macOS that makes this work vs. iOS? – Jeremy Kelleher Jan 24 '19 at 19:02
  • 4
    iOS only allows signed apps. macOS allows both signed and unsigned apps. Please note that the question is tagged [tag:macos]. – rob mayoff Jan 24 '19 at 19:26
  • 1
    After following the instructions above, I had to close and reopen the project for XCode to build successfully. – Tony Rietwyk Dec 09 '19 at 03:12
  • 1
    This is the BEST!!! Love the pictures with arrows -- thank you! – Ultrasaurus Jan 28 '20 at 19:25
  • 1
    it's like magic, now i can build my app without error about provisioning profile – aditsud Apr 18 '20 at 00:08
  • What's exactly the difference of levels vs combined? – mfaani May 30 '20 at 20:13
  • “Levels” shows one column for each possible source of the setting's value, in addition to a column for the effective value. “Combined” only shows the effective value column. I said to click “Levels” because that makes your screen match my screen shots. – rob mayoff May 30 '20 at 20:40
  • 6
    I am getting error `An empty identity is not valid when signing a binary for the product type 'Application'`, any update ? – Top-Master Oct 10 '20 at 11:00
  • Unable to install – Hogdotmac Oct 11 '21 at 09:42
  • might be too late to ask, is this a real blocker in the future if I need a release build? Is this only related to getting a valid certificate and everything will be properly signed? – user3471194 Feb 01 '22 at 19:27
  • I have been using the solution for a long time. But as of new Xcode 14.1, it seems this doesn't work anymore: an error like `An empty identity is not valid when signing a binary...` is output by `codesign`. – prapin Nov 07 '22 at 15:14
  • This still works for Xcode 14.2, target Mac Catalyst. Just 1st time ran you may need to wait longer for OS to parse non-signed files. Subsequent execution runs pretty fast, compared to signing app version. – vedrano Mar 03 '23 at 17:26
55

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.

Abcd Efg
  • 2,146
  • 23
  • 41
  • Hmm...I don't know if I tried changing it in all the targets and the project. – tbodt Aug 13 '15 at 12:41
  • I have tried different methods but this was the only way I could get it to skip the code signing. I hope it helps. – Abcd Efg Aug 13 '15 at 13:01
  • Worked perfectly! Thanks. – tbodt Aug 13 '15 at 23:47
  • 1
    I 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. – lukecampbell Mar 25 '18 at 13:39
  • 7
    This 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. – Jason Nov 25 '18 at 15:22
  • 4
    Xcode 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. – Rhythmic Fistman Dec 17 '18 at 09:07
  • 26
    In Xcode 10, you can choose “Other…” and set the text to empty to disable code signing. See [this answer](https://stackoverflow.com/a/54296008/77567). – rob mayoff Jan 21 '19 at 18:40
  • The answer from @robmayoff is so much clearer and also works for modern (at the time of this writing...) Xcodes (11.3). So it should be the accepted answer these days. – thoni56 Dec 12 '19 at 11:03
10

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"
    )
Marek R
  • 32,568
  • 6
  • 55
  • 140
0

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.

Noah Witherspoon
  • 57,021
  • 16
  • 130
  • 131
  • Would this mean there would be a `.bundle` in my Resource folder that all my stuff would be inside of? – tbodt Aug 12 '15 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. – Noah Witherspoon Aug 13 '15 at 05:04
  • I'll have to try that. – tbodt Aug 13 '15 at 12:41
0

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

mfaani
  • 33,269
  • 19
  • 164
  • 293