How do I use adb to perform some automated tasks on my android phone? I need to find commands that I can issue from the command line (ideally, using a .bat file) that will
The Java example you show is for a program that is running on the phone itself. You might be able to program some kind of an interpreter on the phone that handles adb commands. That way you are not dependent anymore on keyevents. This is not a minor undertaking, however.