LoginSignup
19
17

More than 5 years have passed since last update.

Unity の Build and Run で Xcode 起動が失敗した時するべきこと

Last updated at Posted at 2015-06-13

新しい Unity をインストールしたり、新しい Xcode をインストールすると、以下の様なエラーが出て、Build and Run を実行した時に Xcode を起動出来ない時があります。

UnityException: Launching iOS project via Xcode4 failed. Check editor log for details

Xcode プロジェクトは作成されているので、手動で起動させてもいいのですが、毎回面倒なので設定をして解消します。

設定方法

Unity.app 以下の設定ファイルに、新しい Xcode の ID を追加します。

  1. 起動に対応させたい Xcode の ID を取得する

    • 例えば以下のパスにある Xcodeから、ID を取得するために、Info.plist を開きます
    $ open /Applications/Xcode.app/Contents/Info.plist
    
    • DVTPlugInCompatibilityUUID の値をメモしておく
    • 例えば以下の様になっています

      Screen Shot 2015-06-13 at 11.24.08 PM.png

  2. Unity4XC.xplugin の Info.plist を開く

    • 例えば以下のパスにあります
     /Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/Tools/OSX/Unity4XC.xcplugin/Contents/Info.plist
    
    • Unity のバージョンに依っては、パスが変わっていることがあるので、Unity4XC.xcplugin というディレクトリ名以下の Info.plist か、それらしい名前のディレクトリ以下にある Info.plist を探して下さい。
    • 例えば以下のコマンドです
    $ find /Applications/Unity/Unity.app/Contents/ -name "Info.plist"
    
  3. 1で入手した DVTPlugInCompatibilityUUID を設定する

    • Info.plist の以下の部分に、<string>入手したDVTPlugInCompatibilityUUID</string> を追加して下さい
    <key>DVTPlugInCompatibilityUUIDs</key>
    <array>
        <string>63FC1C47-140D-42B0-BB4D-A10B2D225574</string>
        <string>37B30044-3B14-46BA-ABAA-F01000C27B63</string>
        <string>A2E4D43F-41F4-4FB9-BB94-7177011C9AED</string>
        <string>AD68E85B-441B-4301-B564-A45E4919A6AD</string>
        <string>C4A681B0-4A26-480E-93EC-1218098B9AA0</string>
        <string>FEC992CC-CA4A-4CFD-8881-77300FCB848A</string>
        <string>992275C1-432A-4CF7-B659-D84ED6D42D3F</string>
    </array>
    
    • 例: array タグの中の一番最後に追加
        <string>992275C1-432A-4CF7-B659-D84ED6D42D3F</string>
        <string>E969541F-E6F9-4D25-8158-72DC3545A6C6</string>
    </array>
    

これで Unity を再起動すると、Build and Run をしても、正しく Xcode 起動まで行われるようになります。

検索で見つかる上記の問題を解決する記事では、設定する Xcode の値が決め打ちで書かれているため、うまくいかないことがよく有ります…。
自分が使っている Xcode のバージョンで設定するために、上記の手順で、DVTPlugInCompatibilityUUIDP を調べると解決します。

19
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
17