It's a tool that allow monitoring of android application with logging possibility through ADB. Actually it's some kind of UI for adb and tools on android device - top and dumpsys. There is chart representation of live data, possibility to execute command on device and some kind of interface for logcat. So it's very good when you need to test your application on android device and monitor resources.
Precompiled RPMs (Fedora,RHEL etc) can be found in COPR click below:
$ sudo dnf copr enable yura/androidprocmon
$ sudo dnf install androidprocmon
You can get precompiled package for other OS here:
https://github.com/coozoo/androidprocmon/releases
If you prefer to compile it by yourself then see below.
Suppose you have installed and configured:
Perform next steps:
Download sources to your project dir:
git clone https://github.com/coozoo/androidprocmon
Open QtCreator And open androidprocmon.pro
Compile
Optionally if you want to run it outside qtcreator:
place generated exe file to separate directory and run from command line (or perform manual copy of ddls):
windeployqt androidprocmon.exe
Suppose you have installed and configured:
Perform next steps:
Create dir to build project and change current dir to created one:
$ cd ~
$ mkdir proj
$ cd proj
Download sources to your project dir and browse to it:
$ git clone https://github.com/coozoo/androidprocmon
$ cd androidprocmon
Try if it's compiling. Open QtCreator
And open androidprocmon.pro
Compile. In case of success continue if no try to find what's wrong.
open MAC_build_RELEASE.sh and change variables if needed:
make script executable and run this script
`shell
$ chmod 777 MAC_build_RELEASE.sh
$ ./MAC_build_RELEASE.sh
`
If everything goes fine you will find deployed androidprocmon.app inside working dir.
Currently no any release for linux because of different dependencies so it's (suppose I will add some for fedora and debian). But now you need to compile it:
Suppose you have installed QT5 (on fedora you can do that # dnf install qt5*):
Create dir to build project and change current dir to created one:
$ cd ~
$ mkdir proj
$ cd proj
Download sources to your project dir and browse to it:
$ git clone https://github.com/coozoo/androidprocmon
$ cd androidprocmon
Compile by executing next commands (maybe you need to use qmake if default is qt5):
$ qmake-qt5
$ make
Included languages are only:
English - androidprocmon_en
Ukrainian - androidprocmon_uk_UA
.ts-translations, .qm-compiled translations
So .ts translations files you can use to create your own translation.
Compiled translations .qm should be placed inside "lang" folder which should be placed beside binary.
The main component of this tool it's adb.
There is few predefined locations of adb tool but the better way to place it beside binary (exe file). So application will definitely find it.
File "exec_history" is created automatically to log commands that executed on "Execute" so it's some kind of ".bash_history".
So it's simply list of strings. File placed beside binary.
File "filters_list" its purpose is to save filters list to filter logcat messages.
Can be created manually. File placed beside binary.
It is csv like file and has next format:
FILTER,isRegex
FILTER - it's a word or regex to filter logcat;
isRegex - true/false is it regular expression or not.
File "chart_rules.json" contains the rules how many charts will be appeared and what data they drawing. File placed beside binary.
Attention rules handler very stupid so it can work improperly, maybe later I will reimplement it.
You can copy included "chart_rules.json" file and place it beside binary.
Format next:
Example:
{
"toprules":{"charts":[
{"chart":"CPU","description":"Total CPU load vs Process","legend":"CPU load","vaxislabel":"percents %","graphs":[{"name":"[CPU User+System]","rule":"CPU(User)\\+CPU(System)"},{"name":"[CPU User]","rule":"CPU(User)"},{"name":"CPU process","rule":"CPU%"}]}
]},
"dumpsysrules":{"charts":[
{"chart":"Pss_Total","description":"","legend":"TOTAL|Pss_Total","vaxislabel":"kB","graphs":[{"name":"Pss_Total","rule":"TOTAL|Pss_Total"}]},
{"chart":"Private_Dirty","description":"","legend":"TOTAL|Private_Dirty","vaxislabel":"kB","graphs":[{"name":"Private_Dirty","rule":"TOTAL|Private_Dirty"}]}
]}
}
First at all you need to enable USB debugging to do that:
Go to android settings and scroll down;
If you see "Developers Options" then tap on it and continue from step 6;
To enable "Developers Options" go to "About Phone" and tap on it;
Scroll down and find "Build Number" tap on it a lot of time until you will see message "you are developer";
Go back to root of settings and find "Developers Options" tap on it;
Enable "Developers Options" by toggling switch on top of page;
Scroll down and find "USB debugging" switch on it by switching toggle to the right.
Now you can run application.
If everything fine you will see devices list on the top of "ADB manager" tab after start, there is refresh button to update list of devices if connected after application start.
Select device what you want a deal with:
Go to "Process List" section and press refresh button to get the process list from device
Select the process that you want to monitor, right click on it and select "Monitor Process" from context menu
This process will be automatically added "Top Process Stat Log" and "Dumpsys Proc meminfo" sections. Arrows on them will be green to indicate that monitoring active.
Now you can go to "Chart Manager" tab Here you will see online data on charts. Every chart can be detached and placed back by double clicking on window header.
There is "Range" spinbox. You can set start size in minutes of plot area, as much as more data added it will compress it to fit into plot area. Flow checkbox allow you to left only last data of range, so if range 10 minutes then only last 10 minutes will be on chart.
Another possibility it's to save all charts as images by pressing button with floppy icon
All logged data and images are saved to "stats" folder
$ cd ~/androidprocmon/stats
Inside "stats" folder you will find folders with dates:
dd.MM.yyyy_hh.mm.ss.xxx
Inside each folder there .csv log files for top and dumpsys tables:
NameOfProcess_pid_top.csv NameOfProcess_pid_dumpsys.csv
Images are saved here in the "saved_charts" folder and arranged by folders with date when save button has been pressed.
There is possibility to view logcat. Simply mark "Enable" checkbox on the top left corner. And application will start logcat. Below there is another "Enable" checkbox related to filter section it will filter all messages by word or regexp. It is sometimes very useful to filter just some exceptions.