Mac下android环境搭建
2012-09-26 17:48
197 查看
The Android Development Tools Here are the tools needed to build Android apps: • Sun’s Java Development Kit (JDK)
• Android Software Developer Kit (SDK)
• Eclipse IDE
• Android Developer Tool (ADT) Eclipse plug-in Java Development Kit The first piece of good news for Mac developers is that Mac OS X has JDK 5 already installed, so we can scratch that off the list. If you are running Windows or Linux, download and install JDK 5 or 6, you can find the downloads here. Also worth mentioning before we continue is that Eclipse is not required, however, with the plug-in that Google has developed for Eclipse, they have made the process of editing, compiling, running and debugging quite easy. Android Software Development Kit To get things rolling, start by downloading the SDK, choosing the platform you need for your system. Once you have the zip file downloaded, extract the contents to a folder on your system. In my case, I opted for my home directory in a folder named Android, see the figure below:
In the tools directory, run the application android. From the dialog box that is shown, select Available Packages from the list on the left.
Once you tick the checkbox, a list of sites, packages and archives will appear, choose Install Selected to begin the download process.
Eclipse IDE It will take a few minutes to download the SDK, so this is a good time to download and install Eclipse. There are a number of Eclipse versions available, my choice was Eclipse IDE for Java Developers, version 3.5 Galileo. To install Eclipse, unzip the download into a folder. Since Android development is currently my only need for the IDE, I extracted the files into the android folder created previously, in a new folder with the name eclipse:
Install Android Development Tools (ADT) All the Android tools should now be downloaded. To install the development tools, start Eclipse – from the eclipse folder (wherever you installed it), double click the application Eclipse. From the Help menu, choose Install New Software. Enter the path shown in the dialog box below when prompted and then click Add:
From the Add Site dialog, enter the information as shown here and click OK:
You will now be returned to the previous install dialog, go ahead and click the Developer Tools checkbox.
Click Next a few times to get to the license agreement, review the agreements and click Finish to install.
You will get a warning that you are installing unsigned software, select OK to continue:
When prompted, restart Eclipse. Configure Android Development Kit (ADK) within Eclipse We now need to setup ADK within Eclipse, which entails pointing Eclipse to the Android SDK. From with Eclipse, click the Eclipse menu item and choose Preferences. From the list, choose Android, chances are you will see the popup shown below, stating that the SDK has not yet been installed:
Navigate to the folder where Android SDK is installed and click OK:
Update Environment Variables We can save ourselves some trouble (read frustration) in the future by adding a reference to the Android tools into our path. In Finder, go to your home directory and open the file .bash_profile – this is a hidden file (hence the preceding dot in the filename). Add the following line to the file, replacing /Users/JOHN/Android/tools with the proper path to where you installed the Android tools
export PATH= ${PATH}: /Users /JOHN /Android /tools
Linux: Same as Mac, adding the export to ~/.bash_profile or ~/.bashrc file. Windows: Right-click on My Computer, and select Properties. On the Advanced tab, click Environment Variables button. A dialog should appear, double-click on Path (under System Variables). Add the full path to the tools directory for Android to the existing path. And That Does It At this point we should be good to go. If you run into any issues, or need some help troubleshooting, please refer to the Android Developer site and review Installing the SDK notes. In the next post I’ll jump into creating an Android application, including how to configure an Android Virtual Device (AVD), which will provide a means to run the app in an emulator.
• Android Software Developer Kit (SDK)
• Eclipse IDE
• Android Developer Tool (ADT) Eclipse plug-in Java Development Kit The first piece of good news for Mac developers is that Mac OS X has JDK 5 already installed, so we can scratch that off the list. If you are running Windows or Linux, download and install JDK 5 or 6, you can find the downloads here. Also worth mentioning before we continue is that Eclipse is not required, however, with the plug-in that Google has developed for Eclipse, they have made the process of editing, compiling, running and debugging quite easy. Android Software Development Kit To get things rolling, start by downloading the SDK, choosing the platform you need for your system. Once you have the zip file downloaded, extract the contents to a folder on your system. In my case, I opted for my home directory in a folder named Android, see the figure below:
In the tools directory, run the application android. From the dialog box that is shown, select Available Packages from the list on the left.
Once you tick the checkbox, a list of sites, packages and archives will appear, choose Install Selected to begin the download process.
Eclipse IDE It will take a few minutes to download the SDK, so this is a good time to download and install Eclipse. There are a number of Eclipse versions available, my choice was Eclipse IDE for Java Developers, version 3.5 Galileo. To install Eclipse, unzip the download into a folder. Since Android development is currently my only need for the IDE, I extracted the files into the android folder created previously, in a new folder with the name eclipse:
Install Android Development Tools (ADT) All the Android tools should now be downloaded. To install the development tools, start Eclipse – from the eclipse folder (wherever you installed it), double click the application Eclipse. From the Help menu, choose Install New Software. Enter the path shown in the dialog box below when prompted and then click Add:
From the Add Site dialog, enter the information as shown here and click OK:
You will now be returned to the previous install dialog, go ahead and click the Developer Tools checkbox.
Click Next a few times to get to the license agreement, review the agreements and click Finish to install.
You will get a warning that you are installing unsigned software, select OK to continue:
When prompted, restart Eclipse. Configure Android Development Kit (ADK) within Eclipse We now need to setup ADK within Eclipse, which entails pointing Eclipse to the Android SDK. From with Eclipse, click the Eclipse menu item and choose Preferences. From the list, choose Android, chances are you will see the popup shown below, stating that the SDK has not yet been installed:
Navigate to the folder where Android SDK is installed and click OK:
Update Environment Variables We can save ourselves some trouble (read frustration) in the future by adding a reference to the Android tools into our path. In Finder, go to your home directory and open the file .bash_profile – this is a hidden file (hence the preceding dot in the filename). Add the following line to the file, replacing /Users/JOHN/Android/tools with the proper path to where you installed the Android tools
export PATH= ${PATH}: /Users /JOHN /Android /tools
Linux: Same as Mac, adding the export to ~/.bash_profile or ~/.bashrc file. Windows: Right-click on My Computer, and select Properties. On the Advanced tab, click Environment Variables button. A dialog should appear, double-click on Path (under System Variables). Add the full path to the tools directory for Android to the existing path. And That Does It At this point we should be good to go. If you run into any issues, or need some help troubleshooting, please refer to the Android Developer site and review Installing the SDK notes. In the next post I’ll jump into creating an Android application, including how to configure an Android Virtual Device (AVD), which will provide a means to run the app in an emulator.
相关文章推荐
- mac 下搭建 Android 开发环境
- mac_android_studio_环境搭建
- mac下搭建cocos2d-x的android运行环境
- android开发之mac下jdk的安装及开发环境搭建
- Mac搭建Cocos2d-x 3.x android打包环境
- [Android]mac下开发环境搭建
- mac开发android之环境搭建--JDK
- MAC 下Android Stdio的NDK环境搭建以及开发初步
- mac下android环境搭建笔记(android studio)
- Android 开发:(一)安卓开发环境搭建与配置 (Windows和Mac )以及目录结构介绍
- 在Mac上搭建React Native开发环境(iOS && Android)
- Mac下搭建android开发环境
- MAC下Android的Eclipse开发环境的搭建
- [Android]_[初级]_[Android开发环境搭建入门(MacOSX)]
- android最全学习资料及路线整理分享 (安卓视频教程 从入门到大师 android开发环境搭建 windows和MAC 安卓源码大全4000套)
- 在MAC上搭建cordova3.4.0的IOS和android开发环境
- Mac下Android的Eclipse开发环境的搭建
- MAC 下搭建react-native android开发环境
- mac 搭建Android开发环境
- mac中Android环境的搭建