I'm trying to learn and understand how to use command-line for android development and I've been following the tutorial on the developer.android.com site http://developer.android.com/training/basics/firstapp/running-app.html to try and create an Android Project from scratch in command line on mac with the following:
First I typed:
android list targets Which displayed the following.
Available Android targets: ---------- id: 1 or "android-21" Name: Android 5.0.1 Type: Platform API level: 21 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in Tag/ABIs : no ABIs. ---------- id: 2 or "android-22" Name: Android 5.1.1 Type: Platform API level: 22 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in Tag/ABIs : no ABIs. ---------- id: 3 or "Google Inc.:Google APIs:22" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 1 Description: Android + Google APIs Based on Android 5.1.1 (API level 22) Libraries: * com.android.future.usb.accessory (usb.jar) API for USB Accessories * com.google.android.media.effects (effects.jar) Collection of video effects * com.google.android.maps (maps.jar) API for Google Maps Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in Tag/ABIs : google_apis/x86 From there I had chosen target-id 2
android create project --target 2 --name MyFirstApp \ --path ~/AndroidStudioProjects/MyFirstApp --activity MyActivity \ --package com.example.myfirstapp I've managed to create the project successfully and now I'm trying to run the 'Hello World' app on a device. According to the instructions on the developer android site the next step is to use
chmod +x gradlew to get gradle to build the project.
I've got both Android/sdk/platform-tools and Android/sdk/tools in the path. I've tried this command line in a project that was created using Android Studio and it works with no problems. I'm wondering if I've missed a step
The error I get is
chmod: gradlew: No such file or directory
gradleweven exist before runningchmod? You needgradleto generategradlew.gradlefrom command line into the project? The cli tutorial on developer.android doesn't mention a step prior tochmod~/Library/gradleadded the PATH to the~/Library/gradle/binand in terminal checked I have access to gradle by typinggradle --helpwhich works but when I run the commandchmod +x gradlewI still get the same error message as OP