- Home /
How do I profile on an Android device?
I am trying to use the Profiler to log information (ala this: http://answers.unity3d.com/questions/2228/how-do-i-profile-in-the-web-player), but it does not seem to work (or I can't find the log file). (It does work in my editor though).
Is this feature supported for Android? If so, how do I get it to work (where would I look for the log file, or is there anything special I need to do to set it up?)
If not, is there any other profiling tips for Android?
Edit: Although I accepted the answer below as the best method I found so far, I am still looking for better ways.
FTR for 2014. If you're on a $$anonymous$$ac. It works fine these days; don't forget build settings -> development build on, & autoconnect on. $$anonymous$$ake sure the android phone is IDENTICAL wifi box to your $$anonymous$$ac (forget ethernet, etc) (and mobile data off of course - wastes your money anyway :) ) Hope it helps someone
Answer by Herman-Tulleken · Nov 03, 2010 at 08:11 AM
For now, this is what I am doing to get at least some information:
- Enable "logcat" profiler in the player settings, under Other Settings (Android tab) of Player Settings.
- Make sure USB debugging is enabled on the Android device (check under Settings | Development).
- Run adb through the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer.
This gives a tiny amount of profiling information (frametime, number of tris, time spend in in different areas, etc.), and updates as the program is run. (It also displays Debug.Log messages, which is even more useful than the actual profiling information).
You can click on the adb window to pause output, and press enter to resume. I run adb through PowerShell - I don't know pausing / resuming will work otherwise.
Is it possible to extract this information and display it via a GUI Text Label?
Answer by PJisAnarchist · Sep 27, 2012 at 08:42 PM
http://docs.unity3d.com/Documentation/Manual/Profiler.html
Remote profiling can be enabled on Android devices through two different paths : WiFi or ADB.
For WiFi profiling, follow these steps:
Make sure to disable Mobile Data on your Android device.
Connect your Android device to your WiFi network.
Check the "Autoconnect Profiler" checkbox in Unity's build settings dialog.
Attach your device to your Mac/PC via cable and hit "Build & Run" in Unity Editor.
When the app launches on the device, open the profiler window in Unity Editor (Window->Profiler)
If the Unity Editor fails to autoconnect to the device, select the appropriate device from the Profiler Window Active Profiler drop down menu.
Note: The Android device and host computer (running the Unity Editor) must both be on the same subnet for the device detection to work.
I tried this, but profiler doesn't show anything. Should I run the scene on the PC when i open the profiler.
Answer by pgomes · May 28, 2012 at 09:25 AM
For a better access to the logcat information I would recommend installing eclipse together with the ADT Plugin: http://developer.android.com/sdk/eclipse-adt.html
After installed just go to Window > Show View > Logcat.
It may sound like overkill, but having the ability to pause and filter the messages by process ID, Application Name, etc ... is very helpful.
Agreed, using Eclipse and having an interface to sort/filter and view profiling information is far mouse useful than a command prompt/powershell window.
Answer by ArtyomAbgaryan_old · Aug 29, 2012 at 12:45 AM
Run ..>android-sdk>tools>ddms.bat from sdk folder to see logcat messages (update SDK !)
Your answer
Follow this Question
Related Questions
Unable to connect Profiler to Android 5 Answers
Unity profiler Gfx.WaitForPresentOnGfxThread 2 Answers
Profiler says that game is running at 10ms(100FPS) but on mobile runs at 45FPS. 2 Answers
Unity 2019.3 LWRP strange Performance Issue on android 0 Answers
Video Player Sometimes Not Playing 0 Answers