MIUI 12 : Macrodroid does not launch or stop an application

franckinou

New member
Hello
Under MIUI 12 Macrodroid does not launch applications. Here is the system log and we do not see an application launched (Should this be indicated between the brackets?).
Thank you.Screenshot_2021-06-28-16-55-54-820_com.arlosoft.macrodroid.jpg
 

tanutanu

Well-known member
"Lounch Application" action works fine for me on MIUI12.0.2 for Japanese model.

After updating to Android 11 basis MIUI12 last week, I had to turn on MIUI optimization switch in the developer options section to make "share menu" work correctly. It might affect your case as well.
 

Attachments

  • IMG_20210629_012421.jpg
    IMG_20210629_012421.jpg
    151.9 KB · Views: 23
  • Screenshot_2021-06-29-01-27-17-976_com.android.settings.jpg
    Screenshot_2021-06-29-01-27-17-976_com.android.settings.jpg
    233.8 KB · Views: 24
Last edited:

franckinou

New member
Thanks but on the global version I don't have this optimization option.
But .. I just found out the reason for the problem and I don't have the solution:
If Macrodroid is launched in full screen, in the foreground, no oucis: The applications are launched.
If Macrodroid is minimized or just launched but hidden, applications will not launch. There are notifications, the phone vibrating, etc., but no running applications.
 

Pseudocyclic

Well-known member
If you can't find any other solution, try this:

A: open drawer
A: launch app
A: wait 5ms (may need to be increased)
A: close drawer
 

tanutanu

Well-known member
Thanks but on the global version I don't have this optimization option.
But .. I just found out the reason for the problem and I don't have the solution:
If Macrodroid is launched in full screen, in the foreground, no oucis: The applications are launched.
If Macrodroid is minimized or just launched but hidden, applications will not launch. There are notifications, the phone vibrating, etc., but no running applications.
To unveil the menu, you might tap above "Reset to default values" several times.
Another possibility, if you encountered the issue only when MD was in background, you might check MIUI battery savings again and again.
Basically, Xiaomi devices tend to be crazy even though too huge batteries are loaded.
 

franckinou

New member
Good evening. Solution found: I have given all the proposed rights for the application (Macrodroid). All rights have a green dot now.
The applications are launched at that time.
Thanks everyone.
 

tanutanu

Well-known member
Sounds good:)
Actually, MiUI changed permission settings unexpectedly without any notifications after the update.
 

franckinou

New member
There, I can launch an application but .... cannot stop them, close them.
Is there a solution ?
All possible rights are green and despite this I cannot stop an application, the simplest it may be.
And besides, I cannot check the status of an application: Stopped, started. It doesn't change anything and if I loop it over it continues anyway. Like if the app is started I don't go into the loop. Or a constraint on the fact that an application is stopped.

Use the ADB Hack ? Or an other solution ?
 
Last edited:

tanutanu

Well-known member
There, I can launch an application but .... cannot stop them, close them.
Is there a solution ?
All possible rights are green and despite this I cannot stop an application, the simplest it may be.
And besides, I cannot check the status of an application: Stopped, started. It doesn't change anything and if I loop it over it continues anyway. Like if the app is started I don't go into the loop. Or a constraint on the fact that an application is stopped.

Use the ADB Hack ? Or an other solution ?
It is normal on non-rooted device. If it were Android 10 or earlier versions, you could use Greenify app to freeze processes as a plugin of MD even if non-rooted.
I'm not sure what you did and what you want to do exactly. Why do you mind the apps controlled by OS task manager? Do you have any problems when you leave them as they are?
 

franckinou

New member
With the experimental / moving vehicle option, I launch speed trap alert and android auto. But after every stop at red lights, when I restart, it relaunches both applications.
I will want it to detect the fact that the applications are running and not attempt to do it again.
Even once I'm at home, I want him to stop them on his own.
Here.
 

tanutanu

Well-known member
With the experimental / moving vehicle option, I launch speed trap alert and android auto. But after every stop at red lights, when I restart, it relaunches both applications.
I will want it to detect the fact that the applications are running and not attempt to do it again.
Even once I'm at home, I want him to stop them on his own.
Here.
Even if those apps are still running, it has no problems to be restarted by your macro. The app just comes back foreground when it was still alive. If dead, MD is going to execute it again.
Therefore you don't care about them running or not, simply use "launch application" statement everytime.

If you want to stop the basic behavior when you ride on your car, you can add another trigger to do.
Make a geofenced location and name it as "my home" or something. Then return to your macro, add "Geofence Trigger" to detect where you are.
In the Action section, add "Cancel Macro" on the beginning with "Trigger Fired" constraint working with above geofence location.
It is the easiest way to avoid running your macro near your home. Of cause, you can make it better as you want with your own logic.
 

franckinou

New member
what i want is simple:
As soon as I drive, I automatically launch speedtrapp alert (which will be found in the background), Android auto and then I can manually launch Google Maps for example.
The problem is that as soon as I restart after a stop like at a red light, Speedtrap alert then android auto are restarted. which is not really ideal when driving but especially since Google Maps already launched is then found in the background. Really not the ideal. We totally agree ?
My goal is then to only launch all actions if speedtral alert and / or android auto are not already started. One launch of these applications and only when I start my travel. And not after every stop. Imagine the thing if I get stuck in traffic and get stopped every 100m!
And there the problem is that I cannot detect the fact that these applications are already launched. The loop "if the application is not started then I start the application" does not work. Why ? An idea ?
 

Qarboz

Well-known member
Have you considered using the "Bluetooth event" -> "Device (dis)connected" (with car radio) trigger?
 

tanutanu

Well-known member
what i want is simple:
As soon as I drive, I automatically launch speedtrapp alert (which will be found in the background), Android auto and then I can manually launch Google Maps for example.
The problem is that as soon as I restart after a stop like at a red light, Speedtrap alert then android auto are restarted. which is not really ideal when driving but especially since Google Maps already launched is then found in the background. Really not the ideal. We totally agree ?
My goal is then to only launch all actions if speedtral alert and / or android auto are not already started. One launch of these applications and only when I start my travel. And not after every stop. Imagine the thing if I get stuck in traffic and get stopped every 100m!
And there the problem is that I cannot detect the fact that these applications are already launched. The loop "if the application is not started then I start the application" does not work. Why ? An idea ?
I don't know the root of your issue. Speedtrap? Does it have any relation with MD macro itself? What are you dealing with MD. I had never seen your macro and it is very hard to understand just reading your comment. New apps and new situations are raising up in every posts.

Anyway, even if you have no idea to stop the alerts of Speedtrap and it should be foreground every 100 meters, don't worry, MD can help you. MD have a ability to detect your activity with motion sensor as a trigger. If detect as still and fire the trigger, you can check the foreground app in a if statement in your macro actions.
if foreground app is not Google Maps, simply launch it wherever it is, foreground or background. It should be back again.
If detecting your activity is not good enough, you can use interval trigger as well. Set the trigger working every 1 minute or something and execute Google Maps as a backup action.
These two triggers make it keep on being foreground automatically.
If I were you, looking for Speedtrap alternative and I couldn't find good one unfortunately, simply would give up and stop using such a annoying app though.
 

franckinou

New member
I thought about bluetooth but having an old vehicle the connection is not done automatically. The phone does not stay paired with my car.
Otherwise I take a screenshot of the offending macro.
 

horseliao

New member
You followed steps at dontkillmyapp.com

Thanks. I checked the solution.

Grant Macrodroid the following two rights:
- Display pop-up windows
- Display pop-up windows while running in the background

And then Macrodroid can launch others Apps when triggered by your settings.

对的,开启以下两个权限即可:

后台弹出界面
显示悬浮窗

经验证,起作用的是这两个,必须同时开启,才能确保macrodroid唤起其他app
 
Top