Skip to content

Latest commit

 

History

History
99 lines (60 loc) · 3.47 KB

android-command.md

File metadata and controls

99 lines (60 loc) · 3.47 KB

Android command

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:

GUI

If you run just:

android

you get a GUI to manage the installation of Android dependencies.

Extras

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...

support libraries on ant build

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

create project

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.

gradle

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

http://stackoverflow.com/questions/16619773/failed-to-import-new-gradle-project-failed-to-find-build-tools-revision-0-0

Looks like this template can be found under: tools/templates/gradle

avd

Android Virtual Devices. Manage emulators.

GUI:

android avd

Allows to create and start emulators.

update

Creates a build.xml for some useless Google samples that don't come with it...

android update project -p . -t android-23