LInux配置ANDROID环境

  • 打开命令行终端Terminal, 进行第一次系统更新并安装开发必要的软件包
    shawn@e014-anle-lnx:~$ sudo su
    # apt-get install aptitude
    # aptitude update
    # aptitude full-upgrade
    #
    # aptitude -y install sysv-rc-conf subversion subversion-tools python-svn git-core git-svn binutils binutils-dev binutils-static libncurses5-dev libncursesw5-dev ncurses-term ncurses-hexedit g++ gcc automake1.9 dialog bison build-essential zlib1g-dev flex gperf libwxgtk2.6-dev libcurses-widgets-perl libcurses-perl libcurses-ui-perl libcurses-ruby libruby1.8 libsdl1.2-dev valgrind ncurses-dev libtool libx11-dev vim-gnome exuberant-ctags tree meld pbzip2 wget unrar unzip wmii dwm
    # exit
    exit
    shawn@e014-anle-lnx:~$
    
  • 获取JDK1.5, Eclipse, Android SDK, repo,把下面几个文件copy到本地文件夹
    jdk-1_5_0_22-linux-i586.bin
    eclipse-linux.tar.tgz
    android-sdk-linux.tar.tgz
    repo
  • 安装JDK1.5
    shawn@e014-anle-lnx:~$ sudo su
    # chmod 777 jdk-1_5_0_22-linux-i586.bin
    # ./jdk-1_5_0_22-linux-i586.bin
    # mv jdk1.5.0_22 /usr/local/
    # ln -s /usr/local/jdk1.5.0_22 /usr/local/jdk1.5
    # exit
    exit
    shawn@e014-anle-lnx:~$
    
  • 创建Android工具目录 /home/android/, 并拷贝脚本repo到/home/android/bin
    shawn@e014-anle-lnx:~$ cd /home
    shawn@e014-anle-lnx:/home$ sudo mkdir android
    shawn@e014-anle-lnx:/home$ sudo chmod 777 android
    shawn@e014-anle-lnx:/home$ mkdir /home/android/bin
    shawn@e014-anle-lnx:/home$ mv /home/shawn/repo /home/android/bin/
    shawn@e014-anle-lnx:/home$ chmod 777 /home/android/bin/repo
    
  • 解压缩Eclipse到/home/android/eclipse/, Android SDK到/home/android/sdk/
    shawn@e014-anle-lnx:/home$ tar xf /home/shawn/eclipse-linux.tar.tgz -C /home/android/
    shawn@e014-anle-lnx:/home$ tar xf /home/shawn/android-sdk-linux.tar.tgz -C /home/android/
    
  • 配置环境变量
    shawn@e014-anle-lnx:~$ sudo su
    # echo "
    PATH=/usr/local/jdk1.5/bin:/home/android/sdk/tools:/home/android/sdk/platform-tools:/home/android/bin:/home/android/eclipse:$PATH
    CLASSPATH=/usr/local/jdk1.5/lib:.
    JAVA_HOME=/usr/local/jdk1.5
    ANDROID_JAVA_HOME=$JAVA_HOME
    GIT_SSH=ssh
    export PATH CLASSPATH JAVA_HOME ANDROID_JAVA_HOME GIT_SSH
    " >>/etc/bash.bashrc
    
  • 验证是否安装配置成功, 重新打开一个命令行终端
    shawn@e014-anle-lnx:~$ eclipse &    ##可以启动eclipse
    shawn@e014-anle-lnx:~$ android &    ##可以启动Android AVD Manager
    

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭