xcodebuild
を使用してこれを行う方法はありません。
しかし、私は仕事が私のために完了しているように見える回避策があります。 AppleScriptを使用してXcodeでワークスペースを開き、適切な時間(たとえば10秒)待機してからXcodeを終了します。署名の更新は、ビルドしようとしたときではなく、ワークスペースが開いたときに行われるため、署名の問題を解決するには十分です。
私が使用するAppleScriptは、この(私はインターネットを中心に倒れているのを発見したいくつかのコードに基づいて)です:
tell application "/Applications/Xcode.app"
open "/Users/gary/MyWorkspace.xcworkspace"
set workspaceDocument to workspace document "MyWorkspace.xcworkspace"
-- Wait for the workspace document to load with a 60 second timeout
repeat 120 times
if loaded of workspaceDocument is true then
exit repeat
end if
delay 0.5
end repeat
if loaded of workspaceDocument is false then
error "Xcode workspace did not finish loading within timeout."
end if
-- Xcode will only update the signing for targets in the active scheme,
-- so make sure the required scheme is the active one
set schemeToUse to scheme "SchemeToUse" of workspaceDocument
set active scheme of workspaceDocument to schemeToUse
-- The time taken to update signing issues is related to the number of targets.
-- The number of targets built by a scheme is not exposed through AppleScript,
-- so count the total number of targets in the workspace
set totalTargets to 0
repeat with theProject in projects in workspaceDocument
set totalTargets to totalTargets + (count of targets of theProject)
end repeat
-- For each target, wait a short amount of time
repeat totalTargets times
delay 3.0
end repeat
quit
end tell
あなたは、ワークスペースのパスを変更する必要があります、あなたのケースのためのワークスペース名とスキーム名。
osascript
コマンドを含むコマンドラインからAppleScriptを実行する方法はたくさんありますが、私はこれをPythonからやっています。