6

I'm trying to create an Android project from the command line.

I tried what it is on the following link:

How to create android project with gradle from command line?

android create project \
    --gradle \
    --gradle-version 0.10 \
    --activity Main \
    --package com.example.app \
    --target android-19 \
    --path AppWithGradleTemplate

but I get:

**************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
**************************************************************************

Invalid or unsupported command "create project"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

So, I think that's not an option.

On the deprecation message they say:

For command-line tools, use tools\bin\sdkmanager.bat

but I don't find the way to achieve this.

I want to specify the following parameters on the command line (among others):

- package
- activity name
- target
- etc.

Is gradle an alternative?

Vishal Yadav
  • 3,552
  • 3
  • 23
  • 41
Angel
  • 473
  • 1
  • 9
  • 16
  • This tool is no longer supported. Instead use Android Studio to create AVDs and create projects, or use sdkmanager to view and install SDK packages from the command line. https://developer.android.com/studio/tools/help/android.html – Anvesh523 Aug 31 '17 at 10:48
  • 4
    do you know any other tool that let me create a new android project from scratch using the command line and specifying the parameters above? – davidesp Aug 31 '17 at 10:51
  • @Angel in case it's still relevant for you you can downgrade your android-sdk tools version to 25.2.5 to get the android create project functionality. Working for me (somewhat) with build tools 28.0.2, java 8, gradle plugin 3.0.1 and gradle 4.8.1. – borizzzzz Jul 16 '18 at 09:05

1 Answers1

0

There is no such command in the Android SDK anymore, AFAIK.

CommonsWare
  • 954,112
  • 185
  • 2,315
  • 2,367