Linux版のUnityは次のリンク先等からインストールできるUnityHubでインストールすると思うのですが、MacOS向けにビルドするようにする場合は2019年5月時点ではちょっと手順を踏む必要があったのでメモ。一回作業したら後はやらなくてよくなるので対処は楽です。
" Unity Hub v2.0.0 Release
https://forum.unity.com/threads/unity-hub-v2-0-0-release.677485/
対処法
対処法は次のリンク先に書かれています。
" Can't build Mac OS X target on Linux (Ubuntu 18.04)
https://forum.unity.com/threads/cant-build-mac-os-x-target-on-linux-ubuntu-18-04.586255/
具体的には次の手順を踏むと対処できます。
- Installs→Addから目的のバージョンのUnityを選択し、追加モジュールに
Mac Build Support (Mono)
も選択するようにしてインストール1 - インストールしたUnityのインストールディレクトリ(
~/Unity/Hub/Editor/<バージョン>
)に移動 -
Editor/Data/PlaybackEngines
の中にMacStandaloneSupport
というディレクトリを作成 - 次のファイルを
Editor/Data/PlaybackEngines/MacStandaloneSupport
に移動
- ivy.xml
- modules.asset
- optool
- UnityEditor.OSXStandalone.Extensions.dll
- UnityEditor.OSXStandalone.Extensions.dll.mdb
- Variations
- Whitelists
これで完了です。2〜4の手順はコマンドで示すと次のようになります。
cd ~/Unity/Hub/Editor/<バージョン>
mkdir Editor/Data/PlaybackEngines/MacStandaloneSupport
mv ivy.xml modules.asset optool UnityEditor.OSXStandalone.Extensions.dll UnityEditor.OSXStandalone.Extensions.dll.mdb Variations Whitelists Editor/Data/PlaybackEngines/MacStandaloneSupport
原因…?
~/Unity/Hub/Editor/<バージョン>
にあるmodules.json
を見てみると分かるのですが、Mac Build Support (Mono)
のインストール先が{UNITY_PATH}/Editor/Data/PlaybackEngines/MacStandaloneSupport
ではなく{UNITY_PATH}
になっており、それが原因で正しい場所にMacOS用のモジュールがインストールされていないのが原因です。ただ、インストールする前にmodules.json
を書き換えればいいという訳でも無いため具体的な修正方法は分かりません。多分その内治ると思います。それまではこういう手順でインストールしたものを移動させると大丈夫です。
-
Unityを既にインストールしているなら大丈夫だとは思いますが念のため、Unityをインストールするには右上の自分のアイコン→Manage License→ACTIVATE NEW LICENSEからライセンスを有効化する必要があります。 ↩