If you prefer a simple shell script
Edit [ IGNORE THIS WRONG ANSWER, IT'S FOR ROOT ACCESS]
Just read the non-root part of question again.
Turn on "Show Touches" in Developer Options and write down the exact locations for
Once you have all coordinates you can build a script (.sh)
Heres one i used,
echo 'Swipe Down Notification' input swipe 400 40 450 580 1000 echo 'Swipe Down Quick Actions' input swipe 400 40 450 580 1000 echo 'Toggle Airplane Mode' input tap 280 573 echo 'Wait for toggle' sleep 10.0 echo 'Repeat for new IP Address' input swipe 400 40 450 580 1000 input swipe 400 40 450 580 1000 input tap 280 573 echo 'FINISHED IP REFRESH' sleep 2.0
Swipe start is X400,Y40 end is X450,Y580 duration is 1s.
Using the obove .sh command (input) you can do a lot of the user actions including entering text, opening applications with
am start etc ..
END A CALL input keyevent 6 PRESS HOME input keyevent 3 OPEN CAMERA input keyevent 27 PRESS MENU input keyevent 82 ENTER NUMBER (1) input keyevent 8 ENTER SOME TEXT Hi i am some... SEPERATOR %s input text 'Hi%si%sam%ssome%stext%sto%sbe%swritten%sby%suser' SWIPE FORMAT IS, START POINT - END POINT - msDURATION input swipe 500 800 500 800 5000
Why is it so dangerous to programmatically control a safety feature ? Imagine being on a plane going to Hawaii, and all of a sudden your application decides to turn Airplane mode OFF mid flight, it interferes with the radio signal of the plane and you end up in Mexico ??
Haha, Also it refreshes your connection with the radio tower your receiving a signal from, it changes your IP Adress and gives you a new network ID, this could be abused also and therefore it's best to not allow programmatic access for the user.