[Add SDK Platforms-tools and tools directories to path for ease of development]
1. Use the command to create your own first Project1). Get the Platforms list using commands
list targets
This command can get to all the downloaded good Android platforms, find the desired platforms ID and remember;
It is generally recommended to use the latest ID to compile the project, so that we can create a better application performance, which is strongly recommended by Google;
The Android version that the app can run is not determined by the SDK, it is determined by the minsdk of each project, and the SDK is backwards compatible, and the APK compiled with the latest SDK runs on the lower version of the SDK version, which is more efficient.
2). Create Project with commands
Android Create Project --Target<Target ID>--name Myfirstapp --Path<Path- to-Workspace>/myfirstapp --Activity myactivity -- Package com.Test.Myfirstapp
Path-to-workspace: location to be stored for this project
Target ID: The platform ID selected in the first step
Use the command above to create an Android project into the specified directory.
A project created using this method will have a ant.properties and Build.xml file, and you can use the following command to package the running project:
debugadb install bin/MyFirstApp-debug.apk
2. Install the application using the command
1) switch to the root directory of the project to be installed, compile the project using Gradlew in debug mode, execute the ASSEMBLEDEBUG compilation project with the Gradlew script, and then build the APK file under the outputs directory under the build directory:
windows系统:gradlew.bat assembleDebugMacOS或者Linux系统:$chmod +x gradlew (chmod是为gradlew命令增加执行权限,只要一次) $./gradlew assembleDebug
2) Use the command to open the AVD Manager interface and select an emulator to run:
andriod avd
3) Install the program to the Android device using the installation command:
adb install app/build/outputs/apk/app-debug.apk
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android uses commands to create projects and package installations