Skip to content

Instantly share code, notes, and snippets.

@CheeseStick
Last active October 10, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CheeseStick/a9a78b4ceb4937404d6061de4b4e1cfa to your computer and use it in GitHub Desktop.
Save CheeseStick/a9a78b4ceb4937404d6061de4b4e1cfa to your computer and use it in GitHub Desktop.
Tips

Xcode 8 및 Sierra에서 프로젝트 빌드시 Code Sign 오류가 날 경우

1. 증상

Xcode 8에서 프로젝트를 빌드 할 때 /usr/bin/codesign failed with exit code 1 오류가 나며, resource fork finder information or similar detritus not allowed 와 같은 메시지가 뜨며 빌드가 정상적으로 되지 않는다.

2. 원인

그림 파일들이 가지고 있는 속성에 개발자 및 기타 생성자의 개인정보가 포함되어 있어서 빌드가 정상적으로 되지 않는다.

3. 해결방법

  1. 커멘드 라인을 통해 프로젝트 폴더로 이동하여 다음 명령어를 실행한 후, Xcode 8에서 Clean Project를 수행한 후 빌드를 시도한다.
find  . -type f \( -iname \*.jpeg -o -iname \*.jpg -o -iname \*.png -o -iname \*.bmp \) -exec xattr -c {} \;
  1. Xcode 8 프로젝트 설정의 Build Phases 탭에서 스크립트를 하나 생성하여, 아래를 붙여넣기 한 후, 소스가 컴파일 되기 전 자동으로 실행되도록 한다.
find  "$PROJECT_DIR" -type f \( -iname \*.jpeg -o -iname \*.jpg -o -iname \*.png -o -iname \*.bmp \) -exec xattr -c {} \;
  1. 다음 스크립트를 <파일이름>.sh파일로 저장하여, 실행 권한을 준 후 프로젝트 폴더의 경로를 인자로 주고 실행한다.
chmod +x <파일이름>.sh
#!/bin/bash

if [[ $1 ]]; then
  echo "Running Directory: $1"
  find $1 -type f \( -iname \*.jpeg -o -iname \*.jpg -o -iname \*.png -o -iname \*.bmp \) -exec xattr -c {} \; -exec sh -c 'echo "File information has cleared from ${0%}"' {} \;
  echo "Done!"
else
  echo "enter directory as parameter"
fi

4. References

  1. http://stackoverflow.com/questions/39652867/code-sign-error-in-macos-sierra-xcode-8-resource-fork-finder-information-or
  2. http://stackoverflow.com/questions/39081871/xcode-development-codesigning-issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment