Oculus Questでデバッグするまで
今回のはまりポイント
・Unityのバージョンが新しすぎる(Unity 2019.3.0a4 Personal)と、参考にしていたサイトのやり方ではうまくいかない。
・Oculus Questの開発者モードの確認がスムーズにできなかった。 PCに接続するときはちゃんと純正のケーブルを使うようにする。(使っていたけど、開発者確認のダイアログがずっとでなかった。)
動作環境
Windows 10 Home
Unity Hub 2.0.2
Unity 2019.1.9f1
※画面キャプチャではUnity 2019.3.0a5を使ってやってた。でも、冒頭でも書いた通り、うまくいかない。
うまくいかない件に関しては、以下のサイトで発覚
https://forum.unity.com/threads/solved-android-ndk-missing.689122/
デバッグまでの記録
Oculusアプリで開発者モードにする
スマホのOculusアプリを開く。設定画面を開いて、Oculus Questに接続する。



windowsはadb-driversをインストールする
https://developer.oculus.com/downloads/package/oculus-go-adb-drivers/
——— メモ———
adbのヘルプ
https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-adb/#mobile-android-debug-intro
adb経由での処理
cd C:\Users\xiaot\AppData\Local\Android\Sdk\platform-tools
# インストール済みのアプリの一覧を表示
$ adb shell pm list package
# 削除
$ adb uninstall パッケージ名
————————————————————–
android_winusb.infを右クリックしてメニューに表示されるインストールでインストールする。

Oculus Composite ADB Interfaceがあることを確認

Android SDK & NDK Toolsをインストール
Unity Hubを開く。
右側の展開ボタンを押す



Oculus Integration for Unity – 1.38をインストール
https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022


インポート
ファイルからビルドセッティングを変更Android→Switch Platformをクリック

Player Settings


Other Setting
1.Pakage Nameを変更
2.Minimum API Levelを Android 4.4 ‘KitKat’に変更
3. Valkanを削除


古いバージョンのUnityなら変更できることが後々わかった

最新バージョンではMinimum API Levelの変更が無理だったけど、このバージョンではできた。
あと、Package Name は~.com.hoge.OculusTestみたいな感じにしないとだめだった。このキャプチャのままだとエラーがでる。

android studioをインストールする
https://developer.android.com/studio





初回起動時、設定をインポートするか聞かれた。
その画面のキャプチャはないけど、以下初回起動時の画面。

standardを選択

個人的な好みだけどダークモード

Finishを押す

終わったけど、なんかエラーでてる。
Running Intel® HAXM installerHAXM installation failed. To install HAXM follow the instructions found at: https://software.intel.com/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows

JDKをインストール
https://www.oracle.com/technetwork/jp/java/javase/downloads/index.html
デフォルトのフォルダを選択して実行


Unityのエラー(Unityのバージョン絡み)
エラーが59個ある。

一つずつ、エラーらしきものを消していくことを試みた。
まずこれ
XR is currently not supported when using the Vulkan Graphics API.Please go to ‘Other Settings’ and remove ‘Vulkan’ from the list of Graphics APIs.

other settingsのGraphics APIsでVulkanを消せと言ってるので、消す。
このエラーは直った。

Android NDKのバージョンが推奨されているバージョンと異なるというエラー。
このエラーをもとに調べて
このサイトを見つけて、Unityのバージョンをダウングレードすることに決めた。

Run DeviceでOculus Questを選択。
(選択肢にない場合は、Oculusの電源が入っていることを確認してRefreshを押す。それでもない場合は、Oculusの開発者設定ができてないということ。)
Build And Run を押す

やっとOculus Questでデバッグ実行できた。
参考にしたサイト
https://qiita.com/pira/items/1c935f30d5ba6c020333https://qiita.com/Tomoyuki_Mikami/items/be9b3bf605a5d953be1b
ディスカッション
コメント一覧
まだ、コメントがありません