搭建android 开发环境 (jruby ) ( setup android development in linux)

访问量: 1996

参考: https://github.com/ruboto/ruboto

$ install rbenv/ruby
$ gem install ruboto
$ sudo aptitude install openjdk-7-jdk ( in ubuntu) 
$ install android sdk
$ wget http://mirrors.hust.edu.cn/apache//ant/binaries/apache-ant-1.9.4-bin.zip , then unzip it. 
$ vim ~/.bashrc, 把下面的变量都加进去: 

    ADT_PATH=/sg552/adt-bundle-linux-x86-20130522/
    JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
    ANT_HOME=/sg552/workspace/ant-1.9.4
    ANDROID_HOME=$ADT_PATH/sdk
    PATH=$PATH:$ANDROID_HOME/platform-tools
    PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/build-tools:$ANDROID_HOME/platform-tools
    PATH=$PATH:$ANDROID_HOME/build-tools/android-4.2.2/

$ gem install jruby-jars
$ ruboto setup

这个时候一般会报错: 

sg552@youku:/sg552/adt-bundle-linux-x86-20130522/sdk/build-tools/android-4.2.2$ ruboto setup
WARN: Unresolved specs during Gem::Specification.reset:
      rake (~> 10.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Java runtime             : Found
Java Compiler            : Found
Apache ANT               : Found
Android Package Installer: Found
Android Emulator         : Found
Android SDK Command adb  : Found
Android SDK Command dx   : Found
Platform SDK android-15  : Not found

    !!! Ruboto setup is NOT OK !!!

Android platform SDK for android-15 not found.
Would you like to download and install it? (Y/n): 

意思是问没有找到android-15这个SDK( 它对应着 android 4.0的版本,而我们下载的是 4.4的版本, 外号叫
  android 17 sdk , 所以暂时忽略这个错误)

然后这个程序会为我们自动安装 android-15 ,

Installing Archives:
  Preparing to install archives
  Downloading SDK Platform Android 4.0.3, API 15, revision 3
  Installing SDK Platform Android 4.0.3, API 15, revision 3
    Installed SDK Platform Android 4.0.3, API 15, revision 396%)
  Done. 1 package installed.
Platform SDK android-15  : Found
Java runtime             : Found
Java Compiler            : Found
Apache ANT               : Found
Android Package Installer: Found
Android Emulator         : Found
Android SDK Command adb  : Found
Android SDK Command dx   : Found
Platform SDK android-15  : Found

    *** Ruboto setup is OK! ***

订阅/RSS Feed

Subscribe

分类/category