Skip to content

Instantly share code, notes, and snippets.

@CreatorB
Created June 25, 2016 09:25
Show Gist options
  • Save CreatorB/e436002c07f1a4d99885c5ad109032ea to your computer and use it in GitHub Desktop.
Save CreatorB/e436002c07f1a4d99885c5ad109032ea to your computer and use it in GitHub Desktop.
AST CREATORBE - Awesome Command for Android Source Test
---
#LEVEL : Medium (for beginner please read another source of android cli development with clear installations).
#It's not a normal development-lifecycle, just simple case when you see so many android source code in a bad condition,
#the real hell yeah what the situation is less documentations and you just wanna launch it too see what is it but the sources missed compiled apk too. WTF :v
#and so really time consumed for open match IDE like eclipse or AS just for tell you what the source it.
---
/*
AST CREATORBE - Android Development in Command Line Interfaces (terminal) mode.
#but it isn't clear way "cli development" JUST A PART "Compile source code android from terminal" (... you can edit this gist when you wanna write full tutorial)
*/
//ECLIPSE - OLD ANDROID PROJECT (required : ant,sdk)
$ ant debug
if(situation == "get error Buildfile: build.xml does not exist!","let generate build.xml"){
$ android update project --target <your build target> --path <path to old android project, for current path you can set to . (dot)>
}else if(situation == "you dont know what about build target","let check what is available" ){
$ android list targets
}else {
// apk will generated in <project path>/bin/<name>.apk
// run
$ adb install <name>.apk
}
//GRADLE - ANDROID STUDIO PROJECT (you can try it too for compare how long your ide / terminal take time to compile)
#On Windows platforms, type this command:
> gradlew.bat assembleRelease
#On Mac OS and Linux platforms, type this command:
$ ./gradlew assembleRelease
// assembleRelease for release version, assembleDebug for debug version
// you can get apk on <project path>/app/build/outputs/apk/<name>.apk
/*
SOURCES : https://developer.android.com/studio/build/building-cmdline.html
* when you get error compile about certificate of your app, make sure your keystore path or try to assembleDebug
* for clean project, you can use ./gradlew clean
+/
#Thanks! just a little notes for awesome friends on there to improve your explore feeling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment