Codesign keychain prompt fix
Skill bokuwalily/claude-code-skills/skills/codesign-keychain-prompt-fix
fastlane/xcodebuild の iOS署名中に codesign のキーチェーン許可ダイアログ(「codesignがキー…へアクセスしようとしています」)が出る・固まって消えない時。特に複数ビルド同時実行でダイアログが競合してハングした時に発火。From its SKILL.md
npx -y skills add bokuwalily/claude-code-skills --skill codesign-keychain-prompt-fixAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.1 KB, 958 tokens by cl100k_base, as published. Nobody here has run it
Procedure
症状
- iOSアーカイブ署名中、
codesignが login キーチェーンの秘密鍵にアクセスするため許可ダイアログを出す - 「許可」だと毎回出る。複数ビルド(例: Konomi と Dayleaf)が同時に署名すると SecurityAgent が競合してダイアログが固まり消えなくなる
1. 状況把握
ps aux | grep -iE 'SecurityAgent|codesign|fastlane|xcodebuild' | grep -v grep
同時に走ってる署名系プロセスと、固まった SecurityAgent(/System/.../SecurityAgent.bundle/.../SecurityAgent)の PID を特定。
2. 固まったダイアログを消す
SecurityAgent は killall の SIGTERM を無視するので SIGKILL:
kill -9 <SecurityAgentのPID>
(必要時にOSが自動再起動する安全なプロセス)
3. 根本対処(再プロンプトを止める)= 本命
署名鍵のパーティションリストに codesign を一括登録。ユーザー本人がログインパスワードで実行(自分は password を打たない):
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "<ログインパスワード>" ~/Library/Keychains/login.keychain-db
成功すると変更した鍵の属性一覧をダンプして返す(エラーなし=成功)。Apple Distribution/Imported Private Key/Apple Development 系が列挙されていればOK。
-k "..."を省けば一度だけGUIで聞かれる。
4. 宙ぶらりんのビルドを掃除して再実行
固まった codesign/xcodebuild/fastlane はツリーごと kill -TERM。残ってよいのは com.apple.CodeSigningHelper(OS常駐)のみ。その後、各ビルドを再実行。
Pitfalls
- computer-use では固まったダイアログを操作できない:SecurityAgent は許可外アプリなので screenshot に映らず、クリックも届かない → コマンドで殺すのが正解
killall SecurityAgentは効かない(SIGTERM無視)→ 必ずkill -9- パーティションリスト未設定のまま「許可」を押し続けると鍵ごと・プロセスごとに延々出る。
set-key-partition-listが唯一の恒久解 - 同時複数署名ビルドが競合の根本原因。パーティションリスト設定後は同時でも衝突しないが、設定前は1本ずつ
- ログインパスワードはこちらに保存しない。スクロールバックが気になるなら
clear
Verification
set-key-partition-listがエラーなく鍵一覧をダンプps aux | grep -iE 'codesign|fastlane|xcodebuild'が CodeSigningHelper 以外クリア- 再ビルドで署名ポップが出ずに通る
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.