AntonioRedondo / AnotherMonitor

Monitors and records the CPU and memory usage of Android devices
https://play.google.com/store/apps/details?id=org.anothermonitor
GNU General Public License v3.0
1.1k stars 335 forks source link

Other processes with root? #14

Open RichyHBM opened 4 years ago

RichyHBM commented 4 years ago

Hello, I am awear that android removed this functionality from normal apps, but have just noticed SystemPanel 2 is able to gather per app CPU usage using root. Is this something that might be doable in Another monitor?

AntonioRedondo commented 4 years ago

Hi @RichyHBM,

I had a look at SystemPanel 2 and among all the options the app has I haven't seen real-time CPU use information per app available. Granting development permissions to the app (same effect than having a rooted device) I've seen time spent, battery and power use per app but not what AnotherMonitor tracked before Android 7.0.

SystemPanel 2 has however a somewhat confusing interface. So if you post a screenshot of the part of the app you mean it will help to understand your question.

Antonio

RichyHBM commented 4 years ago

Sorry I just saw your reply! I'm trying to find it but it now isnt appearing to me, I'll spend some more time navigating the UI and see if I can find it

RichyHBM commented 4 years ago

Hey @AntonioRedondo

Ok, so finally managed to figure it out, and it does indeed seem you need root access.

So this is how it looks like by default: Screenshot_20200430-130524_SystemPanel_2

But then if you go into the settings and enable superuser mode Screenshot_20200430-130332_SystemPanel_2

It looks like this (notice the additional processes) Screenshot_20200430-130543_SystemPanel_2

If you then click that live tile, it brings up a better view where you can see the app usage Screenshot_20200430-130417_SystemPanel_2

AntonioRedondo commented 4 years ago

Umm, I see. I have no idea how they do it. A pity it isn't an open source app. I guess they're using some of the methods mentioned on https://github.com/AntonioRedondo/AnotherMonitor/issues/9#issuecomment-437648397.

AntonioRedondo commented 4 years ago

So my personal phone is a gorgeous Asus Zenfone 6. Yesterday I tried to root it in order to see this SystemPanel 2 app working. And I almost brick my phone in the try...

Rooting phones have become an increasing complicated task. In the past I rooted and installed Cyanogen in several phones. It was a fairly standard process: unlocking the bootloader, flashing TWRP on the recovery partition and install the ROM of choice.

However now, all these steps have become ridiculously complex:

Jesus! Things have changed a lot in the last 6 years for Android!

I wish I knew all this before starting to fiddle with my Asus Zenfone 6. Now I have to relock the bootloader if I want to use Google Pay. That means yet another OS reset... After configuring it yesterday which took me several hours. 😭😭😭😭😭

Thankfully I also got an old Google Nexus 10 tablet with TRWP and Android 7.1. Rooting it was a much simpler task. And now I have running SystemPanel 2 seeing apps CPU usage in real time. This means in the future I could investigate how to implement this functionality back to AnotherMonitor, which it seems it can be done on rooted devices with dumpsys cpuinfo.

VA1DER commented 2 years ago

Um, I see. I have no idea how they do it. A pity it isn't an open source app. I guess they're using...

... normal Linux methods. Once you invoke su you can use /proc as per normal.

Attached is a screenshot of htop running under termux. Both are open source.

I hope you'll consider adding support for root. The need for good utilities that use su to get at what Google is locking down is growing.

Screenshot_20220429-003028_Termux