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.
Conversation
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
Turn on stay awake in developer options and the device/screen will stay awake when it's charging.
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
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
Forgot that it's `put` instead of `set`:
To enable it:
adb shell settings put global stay_on_while_plugged_in 7
To disable it:
adb shell settings put global stay_on_while_plugged_in 0


