I can easily automate input events using something like this:
adb shell input tap 300 300
And I am doing this, indeed, to automate configs exporting process for some owner installed apps.
Although, I would like to automate configs exporting process for apps installed by other phone users, but I had no success, so far. This is because other users can't enable ADB.
My phone is using Android 9 (Lineage OS).