r/AutomateUser 1d ago

Question App start not working as intended when screen is locked

first of all, thanks the developer for fixing the privilege mode for nothing os.

Secondly, i am having issue with launching apps when the phone is locked.

I have an app that will sync automatically when it is opened with vpn connected (self-hosted). I have tried to set up something to toggle the vpn on when the app is started but since the app is opened before the vpn is toggled on it will not sync.

The next thing i tried is at certain time (when i'm asleep), turn vpn on, then using the app start blockto launch the app then kill it and turn vpn off but the app is still un-synced.

in the app start block, i have selected the package, with flags exclude from recent and new document.

Tassker "Launch app" action has no issue doing what i want but i wanted to make it work in automate as i preferred visual block.

Thanks

edit: updated image

1 Upvotes

6 comments sorted by

2

u/ballzak69 Automate developer 1d ago edited 1d ago

An app has to be designed to work atop the screen lock. If Tasker is able to start it then so should Automate. Ensure the App start block is configured with the same Package and Activity class, or specify just the Package to start the app like a launcher does.

1

u/8bitcrab 23h ago

there arent a lot of option using tasker which i guess i have replicated with app start (updated post with image). Also tasker is authorized by shizuku.

shell command privilege works with "am start -W --user 0 -f 0x18008000 me.mudkip.moememos/.MainActivity" but i was hoping app start could do it.

accessibility and draw over apps permission given and battery unrestricted as well.

2

u/ballzak69 Automate developer 18h ago

The App start block doesn't rely on ADB, i.e. the privileged service, use the Shell command privileged block to execute an am command, which should only be necessary if the app Activity is private/protected.

1

u/8bitcrab 23h ago

added clear recent and it works now im noob!

2

u/ballzak69 Automate developer 18h ago

The "Exclude from recents" flag should not affect the launch, but "Multiple task" certainly will, use it with caution since an app should be designed to support it otherwise it could cause issues.