MacroDroid lags when logcat event trigger is used and how to store logcat entry line into variable?

chaoscreater

Active member
I recently discovered that you can use logcat event as a trigger in MacroDroid. I gave MacroDroid read_logs permission via adb and was able to capture the logcat events that I want, so that's great.

The problem is that it seems MacroDroid is constantly looking at logcat events and is therefore causing a huge lag on my phone. If I disable the macro, it goes back to normal.

I only need the logcat event to be captured on phone bootup. However, there isn't a constraint suitable for that. There is only a constraint for "time since boot" and I'm testing it atm. But I was wondering if there is a constraint to make the macro run only once on initial boot, e.g. "run once on boot"?

And is it normal for MacroDroid to lag if using event capture as trigger?

More importantly, how can I store logcat events into a variable? I looked up a template in the store and it looks like you just use [logcat_line] and store that into a variable, but it doesn't work like that. If you use "Popup Notification", you can use the option "Logcat Entry Line", but this is not made available if you use "Set Variable".

UPDATE:

nvm, I didn't realize I was using variable with boolean instead of string, stupid me.
 
Last edited:

FrameXX

Well-known member
It's a fact that MacroDroid starts being unresponsive especially if you use more logcat triggers. I already contacted developer about this some months ago, but nothing has changed since about this lagging. I really don't understand how MacroDroid checks the log, if it receives some kind of trigger or just checks logcat continuously, or in some interval, if that's a thing it would be good to have option to set poking time (how often MacroDroid checks the logcat).
 

dsnz

Well-known member
It's a fact that MacroDroid starts being unresponsive especially if you use more logcat triggers. I already contacted developer about this some months ago, but nothing has changed since about this lagging. I really don't understand how MacroDroid checks the log, if it receives some kind of trigger or just checks logcat continuously, or in some interval, if that's a thing it would be good to have option to set poking time (how often MacroDroid checks the logcat).
it's true that the logcat trigger slows down everything and is probably inefficient
of course it would be extremely helpful if @MacroDroidDev explained if the log is checked continuously or if there is an event informing MD for new log entries (which I think is unlikely from my short google searches and even then the android log gathers a ton of log entries every second all the time)
but most important is to find together with @MacroDroidDev guidance options/constraints/actions related to log content that are useful and with light load
eg. a quick idea is in conjunction with another trigger or actions a new constraint that checks the log only for a limited time of some user specified seconds
 

Dm114

Well-known member
I recently discovered that you can use logcat event as a trigger in MacroDroid. I gave MacroDroid read_logs permission via adb and was able to capture the logcat events that I want, so that's great.

The problem is that it seems MacroDroid is constantly looking at logcat events and is therefore causing a huge lag on my phone. If I disable the macro, it goes back to normal.

I only need the logcat event to be captured on phone bootup. However, there isn't a constraint suitable for those. There is only a constraint for "time since boot" and I'm testing it atm. But I was wondering if there is a constraint to make the macro run only once on initial boot, e.g. "run once on boot"?

And is it normal for MacroDroid to lag if using event capture as trigger?

More importantly, how can I store logcat events into a variable? I looked up a template in the store and it looks like you just use [logcat_line] and store that into a variable, but it doesn't work like that. If you use "Popup Notification", you can use the option "Logcat Entry Line", but this is not made available if you use "Set Variable".

UPDATE:

nvm, I didn't realize I was using variable with boolean instead of string, stupid me.
Anyway, as a workaround, you could disable the macro with logcat trigger when boot procedure is finished (let's say a few seconds after bootup time).
 

MacroDroidDev

Administrator
Staff member
On some devices the logcat is written incredibly frequently and for this trigger to work MacroDroid must constantly monitor every single entry. I'm not sure if there is any way I can make it more efficient due to this limitation but I will add a task to my TODO list to re-evaluate the way I am processing this to see if there any efficiency improvements I can make.
 

VladU5

New member
Hi, i have same problem with logcat trigger. When i use 2 or 3 logcat triggers. all work stable. But if i use 6 logcat triggers, it is not work stable, freeze up to 20-30 seconds, but cpu 50% load only. Version 5.18.1. Any ideas? Thanks
 

Endercraft

Moderator (& bug finder :D)
Hi, i have same problem with logcat trigger. When i use 2 or 3 logcat triggers. all work stable. But if i use 6 logcat triggers, it is not work stable, freeze up to 20-30 seconds, but cpu 50% load only. Version 5.18.1. Any ideas? Thanks
Version WHAT ?
What about you update to v5.28 or v5.29 and try again ?
When v5.18 was released I didn't even know the app existed, which is more than 2 years ago...

Or did you meant to say v5.28.1 ?
 

MacroDroidDev

Administrator
Staff member
If you use many logcat triggers then performance is likely to be effected, but as @Endercraft says please ensure you are using the latest version of the app before doing anything else.

If you are using an old version of the app because it's a hacked pirate copy then please don't do that.
 
Top