Conversation

Has anyone ever used Unity with Android? I'm trying to figure out how you run a game on an Android device and get back Console messages while doing so.
1
4
If I do "Build and Run" and then in Console I try to change from "Editor" to AndroidPlayer(ADB...) it just... doesn't work, and if I manually run adb.exe I don't see the console messages I expect to see.
1
2
Do I have to make a Development Build? Do I need some kind of plugin to enable logcat? How does this work?
3
2
OK this sorta fixed it but I'm now having a problem where the device goes to sleep within 30 seconds and breaks things when it does, but the Unity "Build and Run" takes well over a minute to run * _ *
Quote Tweet
Replying to @mcclure111
Build and run with dev build and autoconnect to profiler ticked and the device plugged in. Sometimes just setting the console to target the device doesn't work (no idea why, it's stupid) but autoconnect to profiler seems to force it. Logcat works, but I find it a bit unweildy
3
1
Replying to
Unfortunately, the device is a VR headset so this option is not present as it would be on a phone! D: Previously, my solution for this was electrical tape over the proximity sensor. I guess I gotta go buy more electrical tape.
2
Replying to and
It's probably still supported even if there isn't a UI for the development options. To enable it: adb shell settings set global stay_on_while_plugged_in 7 To disable it: adb shell settings set global stay_on_while_plugged_in 0
2
2
Replying to and
You can use the approach of looking in both of those repositories to figure out how to enable other useful settings even if they don't provide a UI for it. Most of it is probably supported. Best to use a matching tag for the version though. I used Android 11 September 2021 tag.