It is possible to dynamically query an Android device for the current CPU clock similar to what is mentioned in what follows.
adb shell "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
However, it seems like there is not a similar option for GPU. I was wondering if there is a way, anything, to do the same for GPUs. Any help is greatly appreciated.
(CPU/GPU frequencies are not good indicators of speed. I mainly need them for some study on DVFS)
How I found the GPU freq and % for Android Galaxy S5 on OSX/Linux
Attach your phone for debugging.
In terminal: ./adb -s shell dumpsys SurfaceFlinger
Find the line with "GLES:"
The GPU name is there. For the galaxy s5 it is "Mali-T628"
./adb shell find "/sys/" -type f
Search through and find the "mali" folder
use adb shell cat to investigate what the files contain
Used ./adb shell cat /sys/devices/11800000.mali/utilization, which lists the gpu used % as an integer
Used ./adb shell cat /sys/devices/11800000.mali/clock, which lists the gpu freq as an integer
Use those integers in your perf reporting
As Amin mentioned, the best solution is using the profiler. I used Android profiler (like) to measure the performance.
Related
Is there an easy way to get the chip name like the MediaTek SoCs (ARMv5 MT1000 ..) of an Android device using adb shell?
I'm trying to run "adb shell cat system/build.prop" but I don't found the chip or SoC name.
Any Help for that!
To get CPU info of a device via adb try,
adb shell cat /proc/cpuinfo
You will get your soc model number from this you can search it on the Qualcomm product list to find SOC name
adb shell cat /proc/cpuinfo | grep hardware
In some cases you will directly get your product name
At least on Samsung S8, I get the SoC name (exynos8895) by running
adb shell getprop ro.hardware ro.hardware.chipname
Also, I get samsungexynos8895 from
adb shell getprop ro.hardware
I am trying to find device RAM (512 MB or 1GB) using adb shell commands.
Following commands giving more details about the free,used & total memory. But how to find the device overall RAM?
adb shell "cat /proc/meminfo"
adb shell dumpsys meminfo
adb shell procrank
So it looks to me that MemTotal is probably the field you are looking for:
MemTotal — Total amount of physical RAM, in kilobytes.
While it is not the strictly Android, another Linux flavour CentOS provides the following page regarding /proc/meminfo. It seems that Red Hat, and other variants also describe it similarily.
Is there something that is making you suspect that this is not the physical RAM? On my device the value reported for MemTotal matches what I expect.
People who post answers often forget that Windows users don't have access to grep, cat, etc. Add shell to the beginning of your pipe.
.\adb.exe -s whichever-device shell "cat /proc/meminfo | grep MemTotal"
This is assuming you're connected to multiple devices. If you're only connected to one, you can remove -s whichever-device (usually the ip if you're connected by wifi or the device number from the device list if connected by wire.).
How to auto boot a rooted android phone when it is dead and connected to the charger?
I know many people think its not possible as when the device is OFF and ADB isn't running. But it turns out that it is possible to write an application for rooted device.
There is an application for the same #playstore to do just that.
I just want to make similar app. Any ideas or pointers?
I am researching for the same problem (Android 2.3, htc wildfire s), this are my investigation results:
It works! Unfortunaly it works, if you connect the phone without accumulator and after that insert the accu- now its autoboots. Connecting the phone with inserted accu or insert the accu in the unconnected phone does not work.
Not the result I hoped for but maybe a hint for a pointer.
And I found a script solution: https://android.stackexchange.com/questions/39899/auto-boot-when-charger-connected-for-htc-magic
echo "echo skipping chargemon" > chargemon.script
adb pull /system/bin/chargemon chargemon.backup
adb push chargemon.script /sqlite_stmt_journals
adb shell
$ cd /sqlite_stmt_journals
$ su
# mount -o remount,rw /dev/block/mtdblock0 /system
# cat chargemon.script > /system/bin/chargemon
# chmod 755 /system/bin/chargemon
# reboot -p
You should google a bit
i guess your looking for something
similar to this?
https://android.stackexchange.com/q/39899
Mostly you will have to check the boot-sequence of multiple devices and code accordingly as each device will have different setups
for example the app you posted in your question works only for samsung devices
I am new for android programming.How can we get CPU usage per application in android?
your help will be more helpful
Use adb Commands:
adb shell top -m 10
Source:
Technique for indentifying android app CPU usage
Linux:
adb shell top -m 10 | grep packagename
Windows:
adb shell top -m 10 | FINDSTR packagename
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
two approaches:
adb shell "top -n 1"
adb shell dumpsys cpuinfo
Using the new Android Studio 3.0 profiler you can achieve a higher information about the CPU usage and CPU inspection of your APP.
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.
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
You can use app to access these kinds of information. Such as Simple System Monitor, Simple System Monitor.
I am developing an android application on android.
Is it possible (via DDMS or adb shell) for me to do a thread dump of all the threads of my application?
In addition to what ddms supports, via the adb shell you can run
ps -t
or
top -t
While most android shell commands are primitive and take only a subset of standard options, top seems to have some built in help it prints when bad options are given, ps did not, but fortunately its source code is available to examine.