Prashant
Prashant

Reputation: 1469

CPU usage per application in android

I am new for android programming.How can we get CPU usage per application in android? your help will be more helpful

Upvotes: 43

Views: 106153

Answers (8)

ajmal
ajmal

Reputation: 4252

Go to Settings -> Developer Tools -> Show CPU Usage

Then run the app

EDIT: This has to be done in the app. If you are reading this in 2019, use CPU Profiler

Upvotes: 12

xbob.ym
xbob.ym

Reputation: 521

two approaches:

  • adb shell "top -n 1"
  • adb shell dumpsys cpuinfo

Upvotes: 11

Dev Aggarwal
Dev Aggarwal

Reputation: 8516

This let's you monitor in a more top-esque manner

watch -n 0.5 adb shell top -n 1

0.5 is the polling interval

Upvotes: -1

escalator
escalator

Reputation: 889

Source: Technique for indentifying android app CPU usage

  • Linux:

    adb shell top -m 10 | grep packagename

  • Windows:

    adb shell top -m 10 | FINDSTR packagename

Upvotes: 23

flaviussn
flaviussn

Reputation: 1355

Using the new Android Studio 3.0 profiler you can achieve a higher information about the CPU usage and CPU inspection of your APP.

enter image description here

Upvotes: 2

DaPengZi
DaPengZi

Reputation: 3

You can use app to access these kinds of information. Such as Simple System Monitor, Simple System Monitor.

Upvotes: -4

thepoosh
thepoosh

Reputation: 12587

there are a few ways.

the first one is to open the CPU usage in the Jelly Bean developer options.

the second option is to run the adb shell top -m 10 function in your windows Android SDK folder or ./adb shell top -m 10 in your Mac/Linux.

Upvotes: 1

K_Anas
K_Anas

Reputation: 31466

Use adb Commands:

adb shell top -m 10

Upvotes: 72

Related Questions