初装Ubuntu 14.04 64位后,安装calabash-android步骤:
安装jdk+ant
- sudo apt-get update
- sudo apt-get install openjdk-7-jre-headless
- sudo apt-get install openjdk-7-jdk
- sudo apt-get install ant
- sudo apt-get intall make
安装openjdk-7-jdk之前,运行ant
失败:
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar
安装make之前,运行sudo gem install calabash-android -V
失败:
ERROR: Error installing calabash-android:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lc... yes
creating Makefile
make
sh: 1: make: not found
安装Android SDK
- sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
- 下载adt-bundle并解压
http://www.androiddevtools.cn/ 下载Linux 64位adt-bundle-linux-x86_64-20140702.zip,并解压到home目录,
~/.bashrc中设置:
export ANDROID_HOME=$HOME/adt-bundle-linux-x86_64-20140702/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
安装 lib32z1 lib32ncurses5 lib32stdc++6 之前, 打开ADT报找不到文件错误:
Cannot run program "/home/test/adt-bundle-linux-x86_64-20140702/sdk/platform-tools/adb": error=2, No such file or directory' while attempting to get adb version from '/home/test/adt-bundle-linux-x86_64-20140702/sdk/platform-tools/adb'
~/adt-bundle-linux-x86_64-20140702/sdk/tools$ ./adb
bash: ./adb: No such file or directory
~/adt-bundle-linux-x86_64-20140702/sdk/platform-tools$ ls adb -l
-rwxrwxrwx 1 ubuntu ubuntu 1355536 6月 21 18:09 adb
安装ruby+ruby1.9.1-dev+calabash-android
- sudo apt-get install ruby
- sudo apt-get install ruby1.9.1-dev
- 安装 calabash-android
设置淘宝源后再安装:
sudo gem sources --remove http://rubygems.org/
sudo gem sources -a http://ruby.taobao.org/
sudo gem install calabash-android -V
安装ruby1.9.1-dev之前,试图安装calabash-android,将报错:
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
来源:oschina
链接:https://my.oschina.net/u/1990460/blog/315600