Skip to content

Instantly share code, notes, and snippets.

@akhgupta
Last active March 12, 2020 11:57
Show Gist options
  • Save akhgupta/df84c3d84f6557b49090d177478518db to your computer and use it in GitHub Desktop.
Save akhgupta/df84c3d84f6557b49090d177478518db to your computer and use it in GitHub Desktop.
gradlew Shell script Wrapper to Suspend Android Studio before running Gradle Task and resuming once Task is completed
#!/usr/bin/env bash
echo
pkill -SIGSTOP studio
printf "============> Suspending Android Studio <============"
gradleCommand="./gradlew ${@}"
eval ${gradleCommand}
pkill -SIGCONT studio
printf "============> Resume Android Studio <============"
echo
@akhgupta
Copy link
Author

Just replace ./gradlew with ./gradlewSuspendAS.sh

For example:
./gradlewSuspendAS.sh :app:assembleDebug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment