AutoInput Help setting battery optimization for multiple apps

Discussion in 'AutoApps' started by inik, Jan 29, 2019.

  1. inik

    inik New Member

    Joined:
    Nov 5, 2018
    Messages:
    8
    Likes Received:
    0
    I have a OnePlus 6t which has the unfortunate feature of disabling non-optimized apps every time I restart, so Tasker and similar apps fail.

    I'm trying to create an AutoInput task that will go through all of my apps and set them to not-optimized so I can just run that when I restart the phone and not have to go through manually again and again and again.

    I have it working with one item - it just opens settings and then clicks on the various buttons to select the app, check the right boxes, and then "done" to save the changes. But now I need it to go through a fairly long list of apps, not all of which are visible on the screen.

    How would I go about building this so that it can:

    • Loop through an array of app names
    • Scroll to and click on the right app name
    • Repeat the action (set to do-not-optimize, click done) for each app in turn

    I might be able to do this by list position, but that's not really consistent if I add/remove apps.

    There may also be another way entirely of doing this, but AutoInput was my best bet.

    Thanks,

    Nik
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi there. What part of it can't you get to work exactly? :) What did you try?
     
  3. inik

    inik New Member

    Joined:
    Nov 5, 2018
    Messages:
    8
    Likes Received:
    0
    I beat my head against this a little longer and found some examples of people doing similar things, and was able to get it 99% of the way there.

    https://taskernet.com/shares/?user=...kXk7El&id=Task:Reset+App+Battery+Optimization

    I have two problems I'm running into, though:

    If I fire it off while the notification shade is pulled down, sometimes that seems to get in the way so the AutoInput clicks don't do what they're supposed to

    Occasionally it fails to find the app name to click on - I added some UI query steps to try to give it some extra time to "see" it, but it still stalls out once or twice while running. (If I jump in manually and click on the appropriate app, it catches up from there most of the time - that's why I have the pop up with each app name.)

    Thanks for the help!
     
  4. Robert B

    Robert B New Member

    Joined:
    Jul 11, 2018
    Messages:
    25
    Likes Received:
    1
    For the notification shade part, you might try a Close System Dialogs action at the beginning of the task. That will close the notification shade for you.

    Add some Wait actions in between the Autoinput actions before the click event A 500 ms wait should help.
     

Share This Page