2017-09-01 17 views
0

バックグラウンドでXcodeを使用できますが、スクリプトを使用して現在のプロジェクトをコンパイルして実行できますか?他のアプリケーション/コマンドライン/ AppleスクリプトからXcodeを実行

私は主に開発用にAppCodeを使用していますが、Xcodeからホットキーを使用して実行したいと考えています。 AppCodeがコンパイル進行状況バーを正しく表示しない(2番目の画面のXcodeが可能)。また、AppCodeのデバッグ能力はXcodeほど進んでいない。さもなければ、AppCodeはより速く、より良いです。

tell application "Xcode" 
    tell active workspace document to if exists then 
     repeat until (loaded) -- Whether the workspace document has finished loading after being opened 
      delay 1 
     end repeat 
     run -- Invoke the "run" scheme action 
    end if 
end tell 

は、特定のデバイス上で実行するには:

答えて

1

それは、AppleScriptのから可能だが、ここでは(シエラとXcodeのバージョン8.3.3上でテスト)サンプルスクリプトですIテストするデバイスはありませんが、私はこのスクリプトを試してみてください:

tell application "Xcode" 
    tell active workspace document to if exists then 
     repeat until (loaded) -- Whether the workspace document has finished loading after being opened 
      delay 1 
     end repeat 
     --**** run on a specific device **** 
     set active run destination to run destination "iPad Pro (12.9 inch)" -- *** change it to the name of your device *** 

     set schAction to run -- Invoke the "run" scheme action 
     repeat while (get status of schAction) is in {not yet started, running} -- exit the loop when the status is (‌cancelled, failed, ‌error occurred or ‌succeeded), so I press the stop button in Xcode, or I delete the application in the simulator or I quit the simulator. 
      delay 3 
     end repeat 

     --**** run on another specific device **** 
     set active run destination to run destination "iPhone 7" -- *** change it to the name of your device *** 
     run 
    end if 
end tell 
+0

それは速かったし、それは素晴らしいです!ありがとうございました!あなたは偶然にも特定のデバイスで動くことを知っていますか?私はリアルタイムのマルチプレイヤーゲームを作っており、しばしば2つのデバイスで動かす必要があります。 1つのデバイスで実行し、完了するまで待ってから、もう一方のデバイスで実行するのはクールです。 – keyboard

関連する問題