Oculus Quest / Unity もろもろ

Oculus Quest のゲームレビューと、Unityを使った開発について書く

$HOME/Library/Android/sdk/tools/monitor の起動に失敗する問題

Oculus Questでデバッグするにあたって monitor を起動したいが、エラーが出てうまくいかなかった。
$HOME/Library/Android/sdk/tools/lib/monitor-x86_64/configuration/1559226132541.log にログが出ているので見ると、こんな感じ。

java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Info.plistをいじる

ログを見てconfig.iniを見たくなるが今回さわるのはそこじゃなくInfo.plist$HOME/Library/Android/sdk/tools/lib/monitor-x86_64/monitor.app/Contents/Info.plistにあった。
見つからなかったら、find ~/Library/Android/sdk/tools/ | grep Info.plis すると良いと思う。
以下の通り、-vmの行でjavaのパスを指定すると動く。

  <key>Eclipse</key>
        <array>
            <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options:
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java</string>
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>
            -->
            <string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java</string>
            <string>-keyring</string><string>~/.eclipse_keyring</string>
            <string>-showlocation</string>
            <!-- WARNING:
                If you try to add a single VM argument (-vmargs) here,
                *all* vmargs specified in eclipse.ini will be ignored.
                We recommend to add all arguments in eclipse.ini
             -->
        </array>

参考

qiita.com