Reputation: 483
I'm trying to debug Unity game from PC with Windows 10 to Android phone:
File > Build Settings
I've Switch Platform
to Android Settings/About phone
with 7 taps on Build number
I get Developer Options
and turned on USB debugging and tap on Revoke USB debugging authorization I've checked 2 different USB cables with 3 different phones and each device is successfully detected and recognized by PC OS, Unity Remote says "Connect this device with a USB Cable to your computer. Press PLAY in the Unity Editor to test", but Unity Editor by some reason does not shows any of my devices in Edit > Project Settings > Editor
device:
edit:
I've downloaded both Android Studio and separately sdk-tools-windows-4333796.exe
from Command line tools only.
First I've installed from Java SE Development Kit 8u241 jdk-8u241-windows-x64.exe
for Windows x64
In Windows 10 OS Environment Variables/System Variables/Path
, I've added C:\Program Files\Java\jdk1.8.0_241\bin
and C:\Program Files\Java\jre1.8.0_241\bin
In User Variables I've added Variable name: JAVA_HOME
and Variable value: C:\Program Files\Java\jdk1.8.0_241\bin
So, first I did not used sdk-tools-windows-4333796.exe
and have installed Android Studio, here is what Edit > Preferences > External Tools
shows:
Then, I've removed Android Studio and tried to use only sdk-tools-windows-4333796.exe
, I've extracted tools
folder to previously created folders path C:\Android\android-sdk
, then from C:\Android\android-sdk\tools\bin
load sdkmanager.bat
with "platform;android-25"
or "platform;android-26"
argument, but error says:
Warning: File C:\Users\User.android\repositories.cfg could not be loaded. Warning: Failed to find package platform;android-25 [===
] 10% Computing updates... C:\Android\android-sdk\tools\bin>
And finally I've tried install with Unity Hub:
but it same result, device does not appears in Editor, and External Tools shows checked:
and if unchecked:
I'm not quite sure, what I've missed or what I'm doing incorrectly
Any guide, advice or example would be helpful
Upvotes: 0
Views: 4884
Reputation: 1
I think you are trying to connect with Unity Remote 5. If yes go to the Edit>>Project Setting>> Editor then select "Any Android Device" Ref Then hit play. Note to check your device is connected properly open the build setting by clicking ctrl+shift+B then click on refresh button and check the dropdown menu of run device.Build Setting
Upvotes: 0
Reputation: 987
To use Visual Studio 2019 to debug a Unity app running on an Android device connected to USB:
Place breakpoints in the code for single stepping and watching and inspecting variables as needed. 🎉
Upvotes: 2
Reputation: 755
For Unity Remote to work, you need to have the Android SDK on your development machine. Do you have it? If yes, then to specify the location of your Android SDK, go to Edit > Preferences. Unity Docs will help you.
Upvotes: 0