環(huán)境搭建所需可至 http://pan.baidu.com/s/1gd1Kf4Z 下載
注: 此處假定 Ubuntu 用戶名為 chenfei 開(kāi)發(fā)相關(guān)全部存放在 /home/chenfei/Dev/ 下 一、準(zhǔn)備 1.1 下載 JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
選擇 Accept License Agreement 選擇 Linux x64 tar.gz 進(jìn)行下載 此處選擇 jdk-7u51-linux-x64.tar.gz 進(jìn)行下載 文件:/home/chenfei/Dev/jdk-7u51-linux-x64.tar.gz 1.2 下載 Android SDK http://developer./sdk/index.html
選擇其他平臺(tái) 文件:/home/chenfei/Dev/android-sdk_r22.3-linux.tgz 1.3 下載 IntelliJ IDEA http://www./idea/ http://www./idea/download/ 選擇 Linux,下載 Community Edition 版本 文件:/home/chenfei/Dev/ideaIC-13.0.1.tar.gz 1.4 下載 Genymotion 及 IntelliJ IDEA 的 Genymotion 插件 https://cloud./page/launchpad/download/ 文件: /home/chenfei/Dev/genymotion-2.0.3_x64.bin /home/chenfei/Dev/genymotion-idea-plugin-20130716.jar 1.5 注冊(cè) Genymotion https://cloud./ 二、安裝 打開(kāi) “終端” / “Terminal” 執(zhí)行如下命令進(jìn)入 Dev 目錄: cd Dev/ 2.1 安裝 JDK tar zxvf jdk-7u51-linux-x64.tar.gz 目錄:/home/chenfei/Dev/jdk1.7.0_51 2.2 安裝 Android SDK tar zxvf android-sdk_r22.3-linux.tgz 目錄:/home/chenfei/Dev/android-sdk-linux 2.3 安裝 VisutalBox wget -q http://download./virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - sudo sh -c 'echo "deb http://download./virtualbox/debian quantal non-free contrib" >> /etc/apt/sources.list.d/.list' sudo apt-get update sudo apt-get install virtualbox-4.3 2.4 安裝 Genymotion chmod +x genymotion-2.0.3_x64.bin ./genymotion-2.0.3_x64.bin 目錄:/home/chenfei/Dev/genymotion 2.5 安裝 IntelliJ IDEA tar zxvf ideaIC-13.0.1.tar.gz 目錄:/home/chenfei/Dev/idea-IC-133.331 三、配置 3.1 配置 JDK 執(zhí)行:sudo gedit /etc/profile 打開(kāi) profile 文件,復(fù)制如下內(nèi)容到文件末尾,并保存: export JAVA_HOME=/home/chenfei/Dev/jdk1.7.0_51 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:${PATH} 注銷重新登錄 3.2 配置 Android SDK 執(zhí)行:/home/chenfei/Dev/android-sdk-linux/tools/android 打開(kāi) Android SDK Manager 等待聯(lián)網(wǎng)加載 packages 完畢 安裝: Tools Android SDK Platform-tools Android SDK Build-tools Android 4.4.2 (API 19) Documentation for Android SDK SDK Platform ARM EABI v7a System Image Intel x86 Atom System Image Google APIs Sources for Android SDK Extras Android Support Library 點(diǎn)擊 Install 9 packages --> Choose Packages to install --> 依次選中安裝項(xiàng)下 Accept --> Install 等待下載安裝完畢,關(guān)閉 “Android SDK Manager” 窗口 執(zhí)行:sudo gedit /etc/profile 打開(kāi) profile 文件,復(fù)制如下內(nèi)容到文件末尾,并保存: export ANDROID_SDK_HOME=/home/chenfei/Dev/android-sdk-linux export PATH=${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/platform-tools:${PATH} 3.3 配置 Genymotion 執(zhí)行:/home/chenfei/Dev/genymotion/genymotion 打開(kāi) Genymotion 3.3.1 新增虛擬設(shè)備 Add a first virtual device --> Yes --> “Virtual device creation wizard” Connect --> “Connect to Genymotion Cloud” Username --> Password --> Connect 選擇虛擬設(shè)備 --> Next --> “Name of the Genymotion virtual device to create” --> Next --> “Retrieve and deploy Genymotion virtual device” 等待下載完成 --> Finish 3.3.2 Settings General ADB /home/chenfei/Dev/android-sdk-linux OK 3.4 配置 IntelliJ IDEA 打開(kāi)主文件夾 進(jìn)入目錄:/home/chenfei/Dev/idea-IC-133.331/bin/ 雙擊 idea.sh,點(diǎn)擊 “運(yùn)行”,打開(kāi) IntelliJ IDEA I do not have a previous version of IntelliJ IDEA or I do not want to import my settings --> OK 3.4.1 鎖定到啟動(dòng)器 右擊 “IntelliJ IDEA” 在啟動(dòng)器上的圖標(biāo) 鎖定到啟動(dòng)器 3.4.2 安裝 IntelliJ IDEA 的 Genymotion 插件 Plugins --> Install plugin from disk --> /home/chenfei/Dev/genymotion-idea-plugin-20130716.jar --> OK OK --> Restart 3.4.2 創(chuàng)建 Empty Project Finish --> “Empty Project - - IntelliJ IDEA 13.0.1” 關(guān)閉 “Project Structure” 3.4.3 配置 IntelliJ IDEA 3.4.3.1 View --> Toolbar 3.4.3.2 View --> Tool Buttons 3.4.3.3 File --> Settings... --> “Settings” Genymotion --> Select the path to the Genymotion folder --> /home/chenfei/Dev/genymotion --> OK --> OK 3.4.3.4 待補(bǔ)充 四、開(kāi)發(fā) 4.1 創(chuàng)建Android Module File --> New Module --> “New Module” Application Module --> Module name --> Module SDK Module name : HelloWord Module SDK : New... --> “Cannot Create SDK” OK --> “Select Home Directory for JDK” /home/chenfei/Dev/jdk1.7.0_51 --> OK --> “Select Home Directory for Android SDK” /home/chenfei/Dev/android-sdk-linux --> OK --> “Create New Android SDK” OK Next --> Application name --> Package name* --> Create "Hello, World!" activity --> Activity name --> Show device chooser dialog --> Finish 4.2 運(yùn)行 4.2.1 運(yùn)行 Genymotion 虛擬設(shè)備 點(diǎn)擊 --> “Genymotion Device Manager” 選擇 3.3.1 中創(chuàng)建的虛擬設(shè)備 --> Start... 等待虛擬設(shè)備啟動(dòng)完成后關(guān)閉 “Genymotion Device Manager” 4.2.2 運(yùn)行 Android 程序 點(diǎn)擊 --> “Choose Device” --> Choose a running device --> 選擇剛啟動(dòng)的虛擬設(shè)備 --> OK |
|
來(lái)自: ccccshq > 《intellij》