-
-
Save denzuko/2eee7d046f074317cbf5967c72b292a2 to your computer and use it in GitHub Desktop.
Shell scripts for Android development without needing to use Android Studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PACKAGE_NAME := $(shell basename "$(shell pwd)") | |
APP_PID := $(shell adb shell ps | awk -F q=$(PACKAGE_NAME) '$0 ~ q { print $2 }') | |
APKFILE := app/build/outputs/apk/apk-debug.apk | |
.PHONY: all clean build logs install | |
all: build install logs | |
build: | |
@./gradlew assembleDebug | |
install: | |
@adb -d install -r $(APKFILE) | |
@adb shell monkey -p "$(PACKAGE_NAME)" -c android.intent.category.LAUNCHER 1 | |
#@adb shell am start -n $(PACKAGE_NAME)/.MainActivity | |
clean: | |
@adb uninstall $(PACKAGE_NAME) | |
logs: | |
@adb logcat | grep $(APP_PID) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional details:
https://medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676