2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linux版のUnityでビルド対象にMacOSを選べないことへの対処

Last updated at Posted at 2019-05-21

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/

具体的には次の手順を踏むと対処できます。

  1. Installs→Addから目的のバージョンのUnityを選択し、追加モジュールにMac Build Support (Mono)も選択するようにしてインストール1
  2. インストールしたUnityのインストールディレクトリ(~/Unity/Hub/Editor/<バージョン>)に移動
  3. Editor/Data/PlaybackEnginesの中にMacStandaloneSupportというディレクトリを作成
  4. 次のファイルを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を書き換えればいいという訳でも無いため具体的な修正方法は分かりません。多分その内治ると思います。それまではこういう手順でインストールしたものを移動させると大丈夫です。

  1. Unityを既にインストールしているなら大丈夫だとは思いますが念のため、Unityをインストールするには右上の自分のアイコン→Manage License→ACTIVATE NEW LICENSEからライセンスを有効化する必要があります。

2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?