codesign-keychain-prompt-fix
Skill0 starsChanged 5 months agoMITView on GitHub
fastlane/xcodebuild の iOS署名中に codesign のキーチェーン許可ダイアログ(「codesignがキー…へアクセスしようとしています」)が出る・固まって消えない時。特に複数ビルド同時実行でダイアログが競合してハングした時に発火。
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- git-prepush-secret-remote-checkSkill
- gsc-cli-automationSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- html-to-pdf-slide-deckSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- launchd-exit78-exconfig-debugSkill
- llm-content-pipeline-quality-gateSkill
- local-ai-video-pipelineSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
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 以外クリア- 再ビルドで署名ポップが出ずに通る
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

