{"id":322,"date":"2016-11-03T16:07:44","date_gmt":"2016-11-03T08:07:44","guid":{"rendered":"https:\/\/sinofool.net\/blog\/?p=322"},"modified":"2016-11-05T05:47:00","modified_gmt":"2016-11-04T21:47:00","slug":"resolved-codesign-error-over-ssh-on-macos-10-12","status":"publish","type":"post","link":"https:\/\/sinofool.net\/blog\/archives\/322","title":{"rendered":"[Resolved] Codesign error over SSH on macOS 10.12+"},"content":{"rendered":"<h1>Background<\/h1>\n<p>I have <a href=\"https:\/\/gist.github.com\/sinofool\/39dc371e95c799094f7b\">a shell script<\/a> running in Jenkins to build my iOS projects. It runs over ssh on a Mac mini.<\/p>\n<p>This stopped working since upgrading to macOS Sierra.<\/p>\n<h1>Causes<\/h1>\n<p>The root error of this problem is xcodebuild returns permission denied.<\/p>\n<p>After step-by-step try on a hello world program, codesign returns the detailed error:<\/p>\n<blockquote>\n<pre class=\"preContent\">SecKey API returned: -25308, (null)____FILE_PATH____: unknown error -1=ffffffffffffffff<\/pre>\n<\/blockquote>\n<p>The explanation of this error is:<\/p>\n<blockquote>\n<pre class=\"preContent\">$ security error -25308\r\nError: 0xFFFF9D24 -25308 User interaction is not allowed.<\/pre>\n<\/blockquote>\n<p>This does not make any sense because the script created a new keychain and unlocked it. It needs no user interaction.<\/p>\n<h1>Solution<\/h1>\n<p>After three weeks contacting with Apple support, the solution is adding following command before using the newly created keychain:<\/p>\n<blockquote>\n<pre class=\"preContent\">security set-key-partition-list -S apple: -k &lt;Password&gt; -D &lt;Identity&gt; -t private<\/pre>\n<\/blockquote>\n<p>This works perfectly, but I cannot find any related document.<\/p>\n<p>The script have <a href=\"https:\/\/gist.github.com\/sinofool\/39dc371e95c799094f7b#file-cmdbuild-sh-L97-L98\">been updated<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Background I have a shell script running in Jenkins to build my iOS projects. It runs over ssh on a Mac mini. This stopped working since upgrading to macOS Sierra. Causes The root error of this problem is xcodebuild returns permission denied. After step-by-step try on a hello world program, codesign returns the detailed error: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[15,7,5],"tags":[],"class_list":["post-322","post","type-post","status-publish","format-standard","hentry","category-ios","category-mac","category-tech"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":4,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/posts\/322\/revisions\/326"}],"wp:attachment":[{"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sinofool.net\/blog\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}