0

I'm too lazy to reach out and tap the application icon on my tablet. After installing and testing, how do I tell ./gradlew to launch the app? This command returns nothing:

$ ./gradlew tasks --all | grep -i launch

A related question that might fix my ulterior problem is: How to write an Android app that prefers to be on all the time? My app is in-house, so our tablets have no reason to exist except to run our app.

Phlip
  • 5,253
  • 5
  • 32
  • 48
  • 1
    you should be able to that using adb tools, in the answer here https://stackoverflow.com/questions/4567904/how-to-start-an-application-using-android-adb-tools, as far running the application always, you can try this on your Application from the answer here https://stackoverflow.com/questions/8442079/keep-the-screen-awake-throughout-my-activity – Mohammed Abdul Bari Feb 11 '21 at 23:25
  • "how do I tell ./gradlew to launch the app?" -- you would need to write a custom task for that, having it start whatever activity you wish to display, using `adb shell am start`. "How to write an Android app that prefers to be on all the time? My app is in-house, so our tablets have no reason to exist except to run our app." -- you might be looking for "kiosk mode". – CommonsWare Feb 11 '21 at 23:27

1 Answers1

0

Per CommonsWare's comment, try:

adb -s WHATEVER shell am start -n com.mycorp.myapp/com.mycorp.myapp.MainActivity

and forget gradlew because I have all my command lines in a Rakefile already because it's easy to maintain.

Phlip
  • 5,253
  • 5
  • 32
  • 48