Unity remote 5 not working
- Ensure you have enabled USB Debugging in your mobile.
- Ensure you have set Edit -> Project Settings -> Editor -> Device to Any Android Device.
- Ensure you have given the package name in File -> Build Settings -> Player Settings... -> Other Settings (under Android Settings) -> Package Name.
- (Optional) Install USB Driver for your mobile. (Normal USB Driver for Redmi)
- Close Unity Engine
- Connect your mobile via USB.
- Launch Unity Remote 5.
- Launch Unity Engine in PC
- Click on Play
For me the issue was that even though the android SDK had been installed alongside Unity 2019, the SDK path(s) in Edit > Preferences were empty when de-selecting the checkbox. When I hit Browse next to each of the three (JDK, SDK, NDK) then all paths were automatically filled with something similar to C:\Program Files\Unity\Hub\Editor\2019.2.4f1\Editor\Data\PlaybackEngines...
On another machine I tested with, these paths were set automatically, so this is probably a bug some people see and others not.
After this was done, it worked for me, assuming the following setup:
- Device connected to PC using a data cable (not just a charge cable).
- Device has USB debugging enabled via developer mode settings on device.
- Device authenticated on the PC (for me, I needed to change the connection type on the phone after plugging it in from File Transfer to MIDI, which prompted the authentication request, after which I switched it back to File Transfer).
You can see if a device is authenticated or not by running adb.exe in C:\Program Files\Unity\Hub\Editor\2019.2.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools in a command prompt window (cmd) and the 'list' command: adb.exe list
The connected device will either not show at all (so check your cable) or it will show a GUID followed by 'unauthenticated' (so change the connection type as previously mentioned to prompt for authentication) or it will show 'device' in which case we're good to go.
Start with the editor and remote closed, the device connected and authenticated (this is a one-off setup), and then open Unity Remote. Then open the Unity editor, assuming you've already set the SDK paths, and ensure your Project Settings > Editor > Unity Remote Device is set to Any android device.
You do NOT need to set the Build Settings to target android; this is for deploying the .apk file, and nothing to do with using the device as a remote. Likewise you do NOT need to set a package name or anything else in the Build Settings, at least until you want to deploy the built file to the device, but again this is nothing to do with Unity Remote.
To be clear, my game is not targeting android, and has no android build settings set. The unity remote works perfectly to mirror the game view in the editor, and receive input e.g. tap = 'Fire1'.
Ehmm.... I tried everything and then gave up. After a while i updated Unity and it just started working, so yeah. Sorry for wasting your time, but there wasn't any mention that i might just update the engine on the entire internet and i was using Unity 5.4 and Unity Remote 5