Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I uninstall and re-run an app on a device using Android Studio?

Tags:

I am new to Android Studio and I feel that I must be doing something wrong. When running MyApp on an actual device the process goes like this.

  • Edit code.
  • Select the Run command in Android Studio. (Shift+F10)
  • Discover a Bug (on phone)
  • Navigate to Settings --> Application --> MyApp (on phone)
  • Force Stop (on phone)
  • Uninstall MyApp (on phone)
  • Edit code
  • Select the 'Run' command in Android Studio.
  • Repeat again and again.

This is repetitive and time consuming. Is there a way to uninstall MyApp via Android Studio?

If not is there some other more automated way to do this?

BTW I have seen this question How to automatically uninstall android app from device before installing a new version but it does not sufficiently address the issue.

like image 963
nu everest Avatar asked Feb 23 '15 17:02

nu everest


Video Answer


1 Answers

I think this answer is what you're looking for. Basically edit your configuration to perform an uninstall before app launch.

From the Run menu -> Edit Configurations... -> Before Launch -> Add Gradle-aware Make -> ":app:uninstallAll"

enter image description here

like image 143
Frank Yin Avatar answered Sep 21 '22 14:09

Frank Yin