x


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.

more ▼

asked Nov 01 '10 at 11:55 AM

Herman Tulleken gravatar image

Herman Tulleken
1.6k 25 36 56

(comments are locked)
10|3000 characters needed characters left

5 answers: sort voted first

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.

more ▼

answered Nov 03 '10 at 08:11 AM

Herman Tulleken gravatar image

Herman Tulleken
1.6k 25 36 56

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered May 28 '12 at 09:25 AM

pgomes gravatar image

pgomes
78 1 1 3

Agreed, using Eclipse and having an interface to sort/filter and view profiling information is far mouse useful than a command prompt/powershell window.

Jul 20 '12 at 08:24 AM Meltdown
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Sep 27 '12 at 08:42 PM

PJisAnarchist gravatar image

PJisAnarchist
1 1 2 3

(comments are locked)
10|3000 characters needed characters left

Run ..>android-sdk>tools>ddms.bat from sdk folder to see logcat messages (update SDK !)

more ▼

answered Aug 29 '12 at 12:45 AM

ArtyomAbgaryan_old gravatar image

ArtyomAbgaryan_old
1 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2447
x153

asked: Nov 01 '10 at 11:55 AM

Seen: 11789 times

Last Updated: 2 days ago