Reputation: 321
Sorry for the noob question, but how to I view logs when I have built the game as an .APK on an Android device? I know how to view Debug.Log (in the Unity console), but not on Android. If there is something else than Debug.Log, what is it? I just need to log some lines in my script while it is running on an Android device(NOT EDITOR) since I'm having issues with Google Play Leaderboard login.
Thank you so much!
Upvotes: 6
Views: 14266
Reputation: 287
The device must be connected via USB. Development mode and USB debugging must be enabled on device
Upvotes: 6
Reputation: 11
You can use the Android Monitor Device from your SDK/tools folder.
If you want you can see my tutorial:
Upvotes: -3
Reputation: 4427
Debug.Log on Android logs to the system log. Which you can view via $ adb logcat
command.
Plug in your Android phone via USB cable. Open up Terminal and change folder to your Android SDK platform-tools folder, then run:
$ adb logcat
or, to filter only on Unity messages (if you are on mac/linux):
$ adb logcat | grep -e "Unity"
Once you have the phone plugged into USB, you can also use adb to switch it over to Wifi.
But alternatively I also wrote a script for Android to route all Debug.Log over Wifi to a TCP listener. It's one script to add to your scene:
Upvotes: 11
Reputation: 12527
You'll want to use the Unity Profiler. http://docs.unity3d.com/Manual/Profiler.html
You can connect over local wifi, or usb to debug an app on android, ios, or PC.
The unity docs at the link describe the steps.
But in case that page moves:
For WiFi profiling, follow these steps:
For ADB profiling, follow these steps:
Upvotes: 4