Xcode 10, Command CodeSign failed with a nonzero exit code Xcode 10, Command CodeSign failed with a nonzero exit code ios ios

Xcode 10, Command CodeSign failed with a nonzero exit code


I had that problem and Xcode failed to compile on the device, but on simulator, it worked fine.

I solved with these steps:

  1. Open keychain access.
  2. Lock the 'login' keychain.
  3. Unlock it, enter your PC account password.
  4. Clean Project in the product menu.
  5. Build it Again.

And after that everything works fine.


None of the listed solutions worked for me. In another thread it was pointed out that including a folder named "resources" in the project causes this error. After renaming my "resources" folder, the error went away.


For some people this happens after adding a .png file to an existing .scn assets folder, plus also a .wav file.

Xcode, owing to increased security, doesn't like extensions on files. You can fix these one at a time by cd'ing into the directory where the file is and removing their extended file attributes using the 'xattr' command in Terminal.

To Remove All Extended Attributes On a Single File

Use xattr with the -c flag to "clear" the attributes:

xattr -c yourfile.txt

To Remove All Extended Attributes On Many Files

To recursively remove extended attributes on all files in a directory, combine the -c "clear" flag with the -r recursive flag:

xattr -rc /path/to/directory

Fore more detail, seeHow do I remove the "extended attributes" on a file in Mac OS X?

This solution will also help when getting the code signing error: "resource fork, Finder information, or similar detritus not allowed."

Apple documentation: https://developer.apple.com/library/archive/qa/qa1940/_index.html