设置环境变量
The first step in setting up your environment for developing Android applications is downloading the Android SDK starter package. The starter package is not a full development environment — it includes only the core SDK Tools, which you can use to download the rest of the SDK components.
You can get the latest version of the SDK starter package from theSDK download page. Make sure to download the package that is appropriate for your development computer.
After downloading, unpack the Android SDK archive to a safe location on your machine. By default, the SDK files are unpacked into a directory namedandroid-sdk-<machine-platform>
. Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the ADT plugin or when using the SDK tools.
Optionally, you may want to add the location of the SDK's primarytools
directory to your systemPATH
. The primarytools/
directory is located at the root of the SDK folder. Addingtools
to your path lets you run Android Debug Bridge (adb) and the other command linetoolswithout needing to supply the full path to the tools directory.
- On Linux, edit your
~/.bash_profile
or~/.bashrc
file. Look for a line that sets the PATH environment variable and add the full path to thetools/
directory to it. If you don't see a line setting the path, you can add one:export PATH=${PATH}:<your_sdk_dir>/tools
- On a Mac OS X, look in your home directory for
.bash_profile
and proceed as for Linux. You can create the.bash_profile
if you haven't already set one up on your machine. - On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the
tools/
directory to the path.
If you will be using the Eclipse IDE as your development environment, the next section describes how to install the Android Development Tools (ADT) plugin and set up Eclipse. If you choose not to use Eclipse, you can develop Android applications in an IDE of your choice and then compile, debug and deploy using the tools included in the SDK (skip toAdding Platforms and Other Components).
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer