Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I skip code signing for development builds in Xcode?

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?

like image 230
tbodt Avatar asked Jun 25 '15 00:06

tbodt


People also ask

What is the purpose of code signing in Xcode?

Code signing your app assures users that it's from a known source and hasn't been modified since it was last signed. Before your app can integrate app services, be installed on a device, or be submitted to the App Store, it must be signed with a certificate issued by Apple.

How do I codesign in Xcode?

Xcode code signing Select the root project directory, and go to the Signing and Capabilities tab. Here, you can either check Automatically manage signing or do the signing manually. If you check the Automatically manage signing checkbox, then you will just need to select the Team from the drop-down list.

How do I add code signing identity in Xcode?

Generate a Code Signing Certificate using Xcode At the top of the window select Accounts . Click on the + on the lower left corner and select Add Apple ID... A dialog will appear. Add your Apple ID and your password, then select Sign in .

What is automatic code signing?

Automatic code signing means automatically managing the provisioning profiles that are available on your Apple Developer Portal account. If you set up some form of authentication to your Apple account, Bitrise can download and install the provisioning profile for your app during the build process.


3 Answers

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.

like image 59
rob mayoff Avatar answered Oct 01 '22 15:10

rob mayoff


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.

like image 23
Abcd Efg Avatar answered Oct 01 '22 17:10

Abcd Efg


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"
    )
like image 41
Marek R Avatar answered Oct 01 '22 15:10

Marek R