I am attempting to develop an app for the Samsung Gear VR (with the Samsung Galaxy S8) and as it requires me to pull out the USB cable in order to plug the phone onto the Gear VR device, this does not allow me to do USB debugging.
How do I go about exporting error and debug messages into a file I can read in order to figure out what's going wrong?
So far, research has shown that android Unity player does not save to a log file while the other platforms do, and adb is the way to go for USB debugging... Only I can't do that for Gear.
That doesn't exist yet. You have to make one yourself.
1.Subscribe to Unity Log event:
2.Store them in a List. When application is about to exit, serialize to json and save it with
File.WriteAllBytes
.The path to save it to is
Application.persistentDataPath
. See this post that shows where the path can be found on any build in Unity.Below is an example script that reads logs and saves it when app is about to exit. Also, it has the ability to email you the log data. This requires the
DataSaver
class from this post. Note that the email is sent next time the app is re-opened not when it exit.