记录技术旅程
分类: LINUX
2011-03-17 14:06:29
To create an Android project, you must use the android tool. When you create a new project with android, it will generate a project directory with some default application files, stub files, configuration files and a build file.
To create a new Android project, open a command-line, navigate to the tools/ directory of your SDK and run:
android create project \Here's an example:
android create project \Once you've created your project, you're ready to begin development. You can move your project folder wherever you want for development, but keep in mind that you must use the Android Debug Bridge (adb) — located in the SDK platform-tools/ directory — to send your application to the emulator (discussed later). So you need access between your project solution and the platform-tools/ folder.
Tip: Add the platform-tools/ as well as the tools/ directory to your PATH environment variable.
Caution: You should refrain from moving the location of the SDK directory, because this will break the build scripts. (They will need to be manually updated to reflect the new SDK location before they will work again.)
Updating a projectIf you're upgrading a project from an older version of the Android SDK or want to create a new project from existing code, use the android update project command to update the project to the new development environment. You can also use this command to revise the build target of an existing project (with the --target option) and the project name (with the --name option). The android tool will generate any files and folders (listed in the previous section) that are either missing or need to be updated, as needed for the Android project.
To update an existing Android project, open a command-line and navigate to the tools/ directory of your SDK. Now run:
android update project --name <project_name> --target <target_ID>Here's an example:
android update project --name MyApp --target 2 --path ./MyAppProject