1
votes

I can't get the controller emulator to work with Google VR SDK 1.1 & Unity 5.6b3 under Arch Linux 64-bit. If I load the GVRDemo scene in Unit and click the play button to enter Play Mode, the console shows the following:

"Android Debug Bridge (adb) command not found. Verify that the Android SDK is installed and that the directory containing adb is included in your PATH environment variable."

In Windows, you have to add the directory containing the Android Debug Bridge (adb) program to the PATH environment variable in Windows itself (not in the Unity program). Once you do that, the Controller Emulator works fine in Windows. You have to do the same in Linux, evidently, to get Unity to locate adb, and therefore get the Controller Emulator phone working for testing the game.

I've added the following line in my .bashrc and .profile files in my home directory:

"PATH=/home/jesse/Android/Sdk/platform-tools/:$PATH"

This, however, doesn't fix the issue.

I've also added the root directory of the Android SDK to my Unity Preferences > External Tools section.

I don't know how to get Unity and Google VR SDK to recognize the directory containing adb to the PATH environment variable that Unity needs to make the Controller Emulator work.

Is anyone else having this issue? Is there a fix or work-around?

1

1 Answers

1
votes

I was able to locate the culprit and modify Google VR SDK scripts to make it work! Turns out there was an issue in the code of the script file titled "EmulatorClientSocket.cs" regarding non-Windows machines. Here's what I changed, and why:

Originally, in line 111 and 112 of this script, it read:

stringprocessFilename="bash";

stringprocessArguments = string.Format(" -l -c \"{0}\"", adbCommand);

The context is that when Windows is not present (forgive my layman's terms -- I've only started learning coding a month ago) the command to process is this: bash -l -c "adb forward tcp:7003 tcp:7003". The problem is when the -l option is used in the command, the command is interpreted as if coming from a login shell, which - I believe - means that bash isn't looking at the custom environment variables set in the user's .bashrc and .profile files in their home directory. Without looking at those files, bash can't locate the adb command (try running the bold command above in a terminal, and the result will be a prompt saying adb command not found).

To fix it, I simply removed the -l option from line 112, and, voila! Everything works like a charm! Lines 111 and 112 now look like this:

stringprocessFilename="bash";

stringprocessArguments = string.Format(" -c \"{0}\"", adbCommand);

The fix will work when running "unity-editor" or "unity-editor-beta" from the Terminal or Xterm, but running it from the application menu will still produce the adb error and Controller Emulator will not work.