Невозможно сделать это, используя 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
Вам нужно изменить путь рабочего пространства, имя рабочего пространства и имя схемы для вашего случая ,
Существует множество способов запуска AppleScript из командной строки, включая команду osascript
, но я делаю это с Python.