Located under $ANDROID_SDK/tools/android
.
Deprecated around 5.1.1, and no CLI replacement in sight... Studio is recommended for many tasks... TODO source:
- http://stackoverflow.com/questions/35814663/create-android-project-with-gradle-from-command-line-deprecated
- http://stackoverflow.com/questions/10969753/android-command-not-found
If you run just:
android
you get a GUI to manage the installation of Android dependencies.
As of Android 22, "Extras" are not included by default on the Java search path of the build.xml
generated by:
android create project [...]
This includes the support
library, which is used on the default IDE Gradle template. Oh, such a lacking CLI-only support...
- http://stackoverflow.com/questions/17659624/how-to-correctly-include-the-support-library-in-non-eclipse-android-application
- http://stackoverflow.com/questions/18302757/using-android-support-libraries-w-o-an-ide
- http://stackoverflow.com/questions/18525408/how-to-add-android-libraries-with-resources-without-using-eclipse
Copy pasting the Jar from the SDK to under lib/
works.
Dropping the ./jar
in libs/
does not include res/
resources, which may be required by the jar... this solved it for me: http://stackoverflow.com/a/30689979/895245
TODO: why do /home/USER/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib
and ${env.ANDROID_HOME}/extras/google/google_play_services/libproject/google-play-services_lib
fail? http://stackoverflow.com/questions/7925747/how-do-you-set-the-android-library-absolute-path-in-ant-properties
http://developer.android.com/tools/projects/projects-cmdline.html
android create project \
--activity MyActivity \
--name MyName \
--package com.cirosantilli.android_cheat \
--path . \
--target 1
This template contains a build.xml
which is used to configure the ant build system.
--name
goes to build.xml
.
<project name="MyName" default="help">
--package
says in which directory it will be installed. This seems to be the only think that determines which app is which. If you install a second app with the same package, it overrides the old one.
To create a project with a gradlew
se --gradle
and --gradle-version
as mentioned at http://stackoverflow.com/questions/20801042/how-to-create-android-project-with-gradle-from-command-line:
android create project \
--activity MyActivity \
--gradle \
--gradle-version 2.8 \
--name MyName \
--package com.cirosantilli.android_cheat \
--path . \
--target 1
TODO: how to build that project? Getting:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'gradle'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.8.
Required by:
:gradle:unspecified
Looks like this template can be found under: tools/templates/gradle
Android Virtual Devices. Manage emulators.
GUI:
android avd
Allows to create and start emulators.
Creates a build.xml
for some useless Google samples that don't come with it...
android update project -p . -t android-23