How to get Android Logs with Scoped Storage?

Alright, this is not what we want to see, but it will do for now.

Thank you to lion from Multiplayscape with providing me with a solution.

You do need to use a source build, I already am so it’s not too bad, but definitely will be a bummer for those on binary. Also you will need to rebuild the engine which takes time.

In the file: UnrealEngine\Engine\Source\Runtime\Core\Private\Android\AndroidPlatformMisc.cpp

Comment out lines 290 and 321. (Add // before the line.)

Make sure to make a backup and restore this before you release your app as you don’t want logs in your final build. Also since you’re modifying the engine, this will effect every project you use with this source build.

Then rebuild the engine. Takes some time. Rebuild your project and make a new Shipping/For Distribution build.

Now immediately, this does not produce a .txt log file still, but you can access the logs using logcat.

Open command prompt and type adb devices to get your device ID.

Then use the command:
adb -s REPLACE_WITH_DEVICE_ID logcat -s AndroidRuntime -s UE

You will see the equivalent of a log in realtime.

Kind of a dirty fix, but it works for now. Given new Android requirements, I hope an easier remedy becomes available in the future.

1 Like