- Home /
Unity tries wrong Android "run device"
I have an Android phone I use for my development. In adb I get the following two devices. Regardless of what I choose in "run device" settings in "build settings" (I can choose default, my pixel device or "all compatible devices"), I get the following error in console:
CommandInvokationFailure: Unable to retrieve device properties. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
/home/hossein/Android/Sdk/platform-tools/adb -s "emulator-5554" shell getprop
It seems that Unity tries the emulator and I have no way of telling it to try my physical device.
I'm on Ubuntu with Unity 2018.2.7f1.
Answer by astro395 · Jan 11, 2019 at 01:29 PM
I'm having the same problem, but only found a workaround. Changing the "Run Device" on Unity Build Settings also doesn't work. I've had a success in the command line.
First, build (only build, not run) the apk in Unity. If it builds you're probably good to go.
Go to the android SDK folder and in platform-tools you will find adb. List your devices with adb devices
. It should return something like:
List of devices attached
emulator-5554 offline
0044346875 device
Now install the apk directly with adb (the device should be specified before the install command):
adb -s "0044346875" install -r SimpleMobilePlaceholder.apk
Hope it works!
Your answer
Follow this Question
Related Questions
How to get Android 10 (API Level 29) 1 Answer
Gradle build fail Unity 0 Answers
AndroidApiLevel30 ? 0 Answers
Unity Android Build Dosn't Work On The Device But Works In The Editor. 0 Answers