2016-10-18 3 views
3

배경 : Xcode 8에는 '서명을 자동으로 업데이트'할 수있는 새로운 기능이 있습니다. 건물 Mac에 프로비저닝 프로파일이 없으면 Xcode는 자동으로 Apple 개발 포털에서 필요한 프로파일을 가져옵니다. 한 캔 rm -rf ~/Library/MobileDevice/Provisioning\ Profiles 다음 열기 Xcode 프로젝트와 엑스 코드는 엑스 코드에서, 하나는 '업데이트 서명'을 볼 수 있습니다 자동으로 프로파일을 가져옵니다 :Xcode 8/xcodebuild : 명령 줄에서 'Update Signing'을 실행하는 방법?

명령 줄에서 하나의 트리거이 '업데이트 서명'을 수행하는 방법 xcode update signing message

? xcodebuild의 맨 페이지에는 이에 대한 언급이 없습니다. 단순히 'xcodebuild'를 실행해도이 단계가 실행되지 않습니다.

답변

1

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