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를 실행하는 데는 여러 가지 방법이 있지만 파이썬에서 수행하고 있습니다.