Create an android project with the command line, prompting an error: Error: Target id is not valid. Use 'android.bat list targets' to get the target ids.
First, the command used to create the project from the command line is: #>android create project -n HelloWorld -t 6 -p HelloWorld -k org.crazyit.helloworld -a HelloWorld
The reason for the error is because of the parameter: "-t 6". The description of the -t parameter is: -t --target : Target ID of the new project. [required]. I don't understand it very well. In fact, when I check it online, I understand that "-t" is followed by an "id" to indicate which SDK version to use.
Execute the command in the tools folder of the SDK installation directory: Android list targets to see which "id" represents which version of the Android SDK. As shown below:
How to get to "platforms" in the same directory as "tools" at this time, you should be able to understand why "id:1 represents android-18, id:2 represents android-19".
The following is to enter the correct -n parameter according to the actual situation.