闲着没事,就搭建了一下appium的环境,玩了一下,下面是具体过程,有需要的朋友可以参考。
其实流程官网上都有,这里就把它摘出来,使其连贯。
下载源码:
git clone git://github.com/appium/appium
安装Node.js
Setup with Ubuntu:curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -Then install with Ubuntu:sudo apt-get install --yes nodejs
在官网的Get Started:Requirements中,有这样一句话–Make sure you have not installed Node or Appium withsudo
,otherwise you'll run into problems。
可是不用sudo安装的时候很多系统文件夹都没法访问,那就切换到root用户下。
(个人猜想,这里可能是用到了一些root用户下的环境变量,要不然这两者之间也没什么大的差别,用sudo虽然权限有了,但还是用的原先的环境变量)。
Android Setup
To get started, you’ll need to install node.js (v0.10 or greater). Justfollow the instructions for your flavor of linux.Once you’ve got node.js installed, install the Android SDK.You will need to run the ‘android’ tool (included in the SDK, under the ‘tools’ directory).
既然是拿来测试APP,那自然是需要安装SDK的,现在google被墙,官网是下不了,给大家一个地址:http://www.androiddevtools.cn/
关于SDK环境变量之类的设置这里就不多说了。
Run the ‘android’ tool and use it to install an API Level 17 or greater.
这里限定了你的Android API版本,必须是API Level 17以上。
(If you want to run Appium from source, you will also need Apache Ant to build the bootstrap jar that Appium uses for running against Android simulators/devices.)
这里要注意的是,因为我们是从源码中run Appium,所以我们需要去下载Apache Ant,http://ant.apache.org/bindownload.cgi
下载好Ant后,我们需要去SetUp(以下摘至Apache Ant Manual)
Before you can run Ant there is some additional set up youwill need to do unless you are installing the RPMversion from jpackage.org: Add the bin directory to your path. Set the ANT_HOME environment variable to thedirectory where you installed Ant. On some operating systems, Ant'sstartup scripts can guess ANT_HOME (Unix dialects andWindows NT/2000), but it is better to not rely on this behavior. Optionally, set the JAVA_HOME environment variable(see the Advanced section below).This should be set to the directory where your JDK is installed.Operating System-specific instructions for doing this from the commandline are in the Windows, Linux/Unix (bash),and Linux/Unix (csh) sections. Note that using this method,the settings will only be valid for the command line session you run them in.Note: Do not install Ant's ant.jar file into the lib/extdirectory of the JDK/JRE. Ant is an application, whilst the extensiondirectory is intended for JDK extensions. In particular there are securityrestrictions on the classes which may be loaded by an extension.
说的很清楚,把下载好的bin文件放到你自己想要放的路径,添加环境变量ANT_HOME(这里说下最好把这些环境变量放到系统配置文件中,比如/etc/profile,这样所有用户都可以使用)
Assume Ant is installed in /usr/local/ant
. The following sets upthe environment:
export ANT_HOME=/usr/local/antexport JAVA_HOME=/usr/local/jdk1.7.0_51export PATH=${PATH}:${ANT_HOME}/bin
Finally, set $ANDROID_HOME to be your Android SDK path. If you unzipped theAndroid SDK to /usr/local/adt/, for example, you should add this to yourshell startup:export ANDROID_HOME=“/usr/local/adt/sdk”Now you’re set up to run Appium! If you’re running Appium from source, run./reset.sh --android from your Appium checkout to install all thedependencies.
最后配置一下ANDROID_HOME环境变量,指向你的Android SDK。
最后去你的源码目录下,执行./reset.sh –android。到此为止,你的Appium Server就可以启动了。
Appium的设计理念是client/server这种框架形式,那么server好了,是不是得准备client了。
这时就看到Appium的强大之处,竟然支持那么多language,可以随意选择自己擅长的。
git clone git@github.com/appium/python-client.gitcd python-clientpython setup.py install
开源的东西真好,直接下源码,然后看看人家是怎么设计的,提高自己。
安装npm
https://www.npmjs.com/package/npm
修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题
1、在64系统里执行32位程序如果出现/lib/ld-linux.so.2:
bad ELF interpreter: No such file or directory,安装下glic即可
sudo yum install glibc.i686
www.2cto.com
2、error while loading shared libraries: libz.so.1:
cannot open shared object file: No such file or directory
sudo yum install zlib.i686
转载请注明:学时网 » Ubuntu下Appium环境搭建