Unity Remote Splash Screen
Unity Remote 5 Android app splash screen

More tricks to get Unity Remote for Android working on Windows

This article is a continuation of Getting Unity Remote for Android to work on Windows. If you haven’t read that, I suggest you take a look at the article and make sure that Android Build Support (and its accompanying Unity-native SDK, NDK and JDKs) is installed, and that you have tried installing the Google USB Driver.

There are also some simple troubleshooting tips listed in that article that you should try first, before you attempt the ones here.

For ease-of-use, here are some quick links to the respective sections:

  1. Manually setting Android file paths
  2. Using Android Debug Bridge (adb)
  3. Enabling other Developer Options
  4. SDK, NDK and JDK installation issues
  5. Bonus: Hiding Developer Options again
  6. Afterword

Manually setting Android file paths

Update 24 August 2020: This section was added after one of the readers from another article posted this helpful tip. It got Unity Remote working on one of my computers!

By default, if you’re using the SDK, NDK and JDK provided by Unity’s Android Build Support installation, going to Edit > Preferences > External Tools should give you the following window.

Unity's External Tools window
If you don’t have the whole section in the red box, you’ll want to install Android Build Support first.

What has worked for some people (including myself), is:

  1. Unchecking the JDK, SDK and NDK fields (the first three checkboxes in the red box), then;
  2. Manually setting the paths to Unity’s JDK, SDK and NDK files.

Yes, we’re basically using the JDK, SDK and NDK files provided by Unity, but manually linking them to Unity instead of checking the checkboxes and allowing Unity to do it for us.

Once you uncheck each of the checkboxes, you should see a text field and a Browse button right beside. Clicking on each Browse button should automatically fill up the accompanying text field with the path to the Unity installed NDK, SDK and JDK respectively.

Manually set Unity NDK, SDK and JDK
There will still be a warning message below each field, but you can ignore them.

If clicking on the Browse button doesn’t work for you, you’ll have to find the files manually. They should be in either of these folders:

  • C:\Program Files\Unity\Hub\Editor\[YOUR_UNITY_VERSION]\Editor\Data\PlaybackEngines\AndroidPlayer
  • C:\Program Files\Unity\Editor[YOUR_UNITY_VERSION]\Editor\Data\PlaybackEngines\AndroidPlayer

The SDK and NDK are in the SDK and NDK folders respectively, but the JDK is in OpenJDK\Windows.

After this is done, you might also want to restart Unity Editor and Unity Remote, and then reconnect your mobile device, before trying again.


Article continues after the advertisement:


Using Android Debug Bridge (adb)

In some cases, you’ll find that regardless of what you do, Unity Remote just doesn’t seem to work. In this case, it might be because your computer is unable to detect your Android device. adb.exe is a command-line tool included with Android SDKs, and it can help with that.

If you are using Unity 2019.1 and above, you don’t have to download anything to access adb.exe — it comes with Unity’s Android Build Support module, if you installed the Android SDK included with it. You should be able to find adb.exe in C:\Program Files\Unity\Hub\Editor\[YOUR_UNITY_VERSION]\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools, unless you installed Unity in a custom folder.

A possible alternative location for the file is C:\Program Files\Unity\Editor\[YOUR_UNITY_VERSION]\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools. Alternatively, you can search your drive for adb.exe to find the folder.

Android Debug Bridge on Unity
If you find adb.exe in the folder, then you’re on the right track.

If you try clicking adb.exe to run it, you will find that nothing much happens. That’s because adb.exe is a command line application, which means you need to run it in Window’s Command Prompt to use it.

  1. To open the Command Prompt, press Windows + R on your computer to open the Run dialog. Type in cmd, and instead of pressing Enter, press Ctrl + Shift + Enter to run the program as an Administrator.
  2. We will need to navigate to the folder where adb.exe is in the Command Prompt before we can access the program. Type cd into the Command Prompt, followed by the path of the directory adb.exe is in, i.e. cd C:\Program Files\Unity\Hub\Editor\[YOUR_UNITY_VERSION]\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools.

Execute the adb devices command once you are in the platform-tools folder containing adb.exe. The adb devices command runs adb.exe and lists all the devices that the Android SDK is currently detecting.

C:\Program Files\..\platform-tools>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
a1b2c3d4e5f6g7    device

If you get an output similar to the green highlighted section above, restart 1) the Unity Editor and; 2) your Unity Remote, then; 3) unplug and plugin your Android device, then try running Unity Remote again. If it still doesn’t work, try the instructions on the next paragraph.

If you don’t get an output, it means that your Android device is not being read, and this is probably what is causing Unity Remote to not work. You might want to try a different USB cable, a different USB port, or a different device altogether.

Alternatively, you can run the following on adb to restart it, and then run adb devices again.

C:\Program Files\..\platform-tools>adb kill-server
C:\Program Files\..\platform-tools>adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
C:\Program Files\..\platform-tools>adb devices
List of devices attached
a1b2c3d4e5f6g7    device

Article continues after the advertisement:


Enabling other Developer Options

For some people, Unity Remote has managed to work after they’ve enabled the Stay awake option in Developer Options.

Stay awake in Developer Options
Your Android will stay up all night for you.

For others, it started working after they changed their USB configuration (again, in Developer Options) from MTP (Media Transfer Protocol) to PTP (Picture Transfer Protocol).

PTP in Developer Options
No witty caption here. Move on.

Depending on your device model, the USB configuration setting might be found in another tab instead of Developer Options.

If you can’t find the option that allows you to change your connection to PTP, take a look at this article from another site.

SDK, NDK or JDK installation issues

While installing the Android SDK, NDK and JDK alongside Unity’s Android Build Support, some people have reported the following issues:

  • OpenJDK installs halfway and stops without any notice. You can look at this Unity Forum topic about this issue.
  • The Unity-native SDK or NDK is not compatible with the current project. If you get this, you’re just plain unlucky.

If you run into this issue, one way to go around it is to find people who have managed to get Unity Remote working on their computers and devices, or, at the very least, has a working Android Build Support module with the SDK, NDK and JDK installed.

Why? So that you can copy the SDK, NDK and / or JDK files on their Unity installation over. By the way, only copy the ones that don’t work — you probably don’t need all 3!

Unity's Android SDK, NDK and JDK
Where all the goods are.

Bonus: Hiding Developer Options again

For some of you, when you’re done messing with Unity Remote, you might want to hide Developer Options again on your device. You know, what with cybersecurity being a buzzword nowadays and all.

Just head into Developer Options again, and tap the knob on the top right. This will also turn off USB debugging and set the rest of your Developer Options back to their defaults.

Disabling Developer Options in Android
Bet some of you didn’t see that until now.

Afterword

As with our previous Unity Remote article, if you:

  1. Find any errors in this article, or;
  2. Find a method that gets Unity Remote to work, that is not listed in this article;

Please leave a comment with the details! This article will be constantly updated with new findings, and you’ll be doing a public service to everyone else who is or will be going through the same battle of getting Unity Remote to work.


Article continues after the advertisement:


Leave a Reply

Your email address will not be published.