2016-10-18 6 views
3

背景:Xcode 8には、「自動的に署名を更新する」ための新しい機能があります。ビルドマックにプロビジョニングプロファイルがない場合、Xcodeは必要なプロファイルをApple開発ポータルから自動的に引き出します。 一つの缶rm -rf ~/Library/MobileDevice/Provisioning\ Profilesその後、オープンXcodeプロジェクト、とXcodeはXcodeで、1は「更新署名」を参照されます自動的にプロファイルを引っ張ってくる:Xcode 8/xcodebuild:コマンドラインから 'Update Signing'を起動する方法は?

コマンドラインから1つのトリガーこの「更新署名」をどのようにxcode update signing message

? xcodebuildのmanページにはこれに関する言及はありません。単に '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を実行する方法はたくさんありますが、私はこれをPythonからやっています。

関連する問題