title: How to code sign mac app on osx
body: <p>I have created an app on osx 10.9 using python 2.7 so not using xcode. I code signed it with certificate but when checked with <strong>spctl</strong> command, it is showing <strong>rejected</strong>.</p>
  
  <p><strong>Commands</strong> are:</p>
  
  <pre><code>codesign -s "3rd Party Mac Developer Application: Cloud Inc" -v -f /Applications/Cloud/logout.app/Contents/Frameworks/Python.framework/Versions/2.7
  codesign -s "3rd Party Mac Developer Application: Cloud Inc" -v -f --entitlements /Users/Cloud/Desktop/app.entitlements /Applications/Cloud/logout.app/Contents/MacOS/python
  codesign -s "3rd Party Mac Developer Application: Cloud Inc" -v -f --entitlements /Users/Cloud/Desktop/app.entitlements /Applications/Cloud/logout.app/Contents/MacOS/logout 
  codesign -s "3rd Party Mac Developer Application: Cloud Inc" -v -f --entitlements /Users/Cloud/Desktop/app.entitlements /Applications/Cloud/logout.app
  spctl --assess --type execute /Applications/Cloud/logout.app
  /Applications/Cloud/logout.app: rejected
  </code></pre>
  
  <p>My <strong>info.plist</strong> file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
      &lt;string&gt;English&lt;/string&gt;
      &lt;key&gt;CFBundleDisplayName&lt;/key&gt;
      &lt;string&gt;logout&lt;/string&gt;
      &lt;key&gt;CFBundleExecutable&lt;/key&gt;
      &lt;string&gt;logout&lt;/string&gt;
      &lt;key&gt;CFBundleIconFile&lt;/key&gt;
      &lt;string&gt;cc.icns&lt;/string&gt;
      &lt;key&gt;CFBundleIdentifier&lt;/key&gt;
      &lt;string&gt;com.cloud.macapp.logout&lt;/string&gt;
      &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
      &lt;string&gt;6.0&lt;/string&gt;
      &lt;key&gt;CFBundleName&lt;/key&gt;
      &lt;string&gt;logout&lt;/string&gt;
      &lt;key&gt;CFBundlePackageType&lt;/key&gt;
      &lt;string&gt;APPL&lt;/string&gt;
      &lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
      &lt;string&gt;4.4&lt;/string&gt;
      &lt;key&gt;CFBundleSignature&lt;/key&gt;
      &lt;string&gt;CC4B&lt;/string&gt;
      &lt;key&gt;LSApplicationCategoryType&lt;/key&gt;
      &lt;string&gt;public.app-category.reference&lt;/string&gt;
      &lt;key&gt;CFBundleVersion&lt;/key&gt;
      &lt;string&gt;4.4&lt;/string&gt;
      &lt;key&gt;LSHasLocalizedDisplayName&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;NSAppleScriptEnabled&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;NSHumanReadableCopyright&lt;/key&gt;
      &lt;string&gt;Copyright © 2014 Cloud, Inc.&lt;/string&gt;
      &lt;key&gt;NSMainNibFile&lt;/key&gt;
      &lt;string&gt;MainMenu&lt;/string&gt;
      &lt;key&gt;NSPrincipalClass&lt;/key&gt;
      &lt;string&gt;NSApplication&lt;/string&gt;
      &lt;key&gt;PyMainFileNames&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;__boot__&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;PyOptions&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;alias&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;argv_emulation&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;emulate_shell_environment&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;no_chdir&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;prefer_ppc&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;site_packages&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;use_faulthandler&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;use_pythonpath&lt;/key&gt;
          &lt;false/&gt;
          &lt;key&gt;verbose&lt;/key&gt;
          &lt;false/&gt;
      &lt;/dict&gt;
      &lt;key&gt;PyResourcePackages&lt;/key&gt;
      &lt;array&gt;
      &lt;/array&gt;
      &lt;key&gt;PyRuntimeLocations&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;@executable_path/../Frameworks/Python.framework/Versions/2.7/Python&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;PythonInfoDict&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;PythonExecutable&lt;/key&gt;
          &lt;string&gt;/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python&lt;/string&gt;
          &lt;key&gt;PythonLongVersion&lt;/key&gt;
          &lt;string&gt;2.7.8 (default, Jul  7 2014, 20:30:57) 
  [GCC 4.2.1 (Apple Inc. build 5664)]&lt;/string&gt;
          &lt;key&gt;PythonShortVersion&lt;/key&gt;
          &lt;string&gt;2.7&lt;/string&gt;
          &lt;key&gt;py2app&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;alias&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;template&lt;/key&gt;
              &lt;string&gt;app&lt;/string&gt;
              &lt;key&gt;version&lt;/key&gt;
              &lt;string&gt;0.8&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>And <strong>app.entitlements</strong> file is :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;com.apple.security.app-sandbox&lt;/key&gt;
      &lt;true/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>Please check info.plist and app.entitlements and command, suggest some remedies to resolve this rejected thing which checking with spctl.</p>