安装STF

相关依赖下载安装

安装STF_第1张图片

1.基本命令安装

安装wget、zip等命令,后面有需要

yum install wget
yum install -y unzip zip

2.java环境配置

首先下载jdk

cd /usr/local
mkdir java
cd java
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm"
rpm -ivh jdk-8u151-linux-x64.rpm 

配置环境变量

vi /etc/profile

在文件中增加如下内容:

export JAVA_HOME=/usr/java/jdk1.8.0_151
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

验证环境是否ok:

java -version

[root@centos158 ~]# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

3.android SDK环境配置

首先下载SDK

cd /usr/local
mkdir android
cd android
wget  https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip  sdk-tools-linux-3859397.zip

 安装platform-tools

sdkmanager "platform-tools"

配置环境变量

vi /etc/profile

在文件中增加如下内容:

export PATH=$PATH:/usr/local/android/platform-tools
export PATH=$PATH:/usr/local/android/tools/bin

执行

source profile 
sdkmanager --list
安装STF_第2张图片

验证环境是否ok:

adb version

[root@centos158 ~]# adb version
Android Debug Bridge version 1.0.40
Version 4797878
Installed as /usr/local/android/platform-tools/adb

4.node安装

cd /usr/local
mkdir node   
cd node
wget  https://nodejs.org/download/release/v9.0.0/node-v9.0.0-linux-x64.tar.gz
tar xvf node-v9.0.0-linux-x64.tar.gz
ln -s /usr/local/node/node-v9.0.0-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/node/node-v9.0.0-linux-x64/bin/npm /usr/local/bin/npm

检查环境

node -v
npm -v

[root@centos158 ~]# node -v
v9.0.0
[root@centos158 ~]# npm -v
5.5.1

5.rethinkdb安装

cd /opt/dong       -----即在opt新建一个目录用来用来其他依赖
wget http://download.rethinkdb.com/centos/7/x86_64/rethinkdb.repo -O /etc/yum.repos.d/rethinkdb.repo  --地址要根据centos7还是6和操作系统自己选择地址
yum install rethinkdb

检查环境是否ok:

rethinkdb -v

[root@centos158 ~]# rethinkdb -v
rethinkdb 2.3.6 (GCC 4.8.3)

6.GraphicsMagick安装

cd /opt/dong
wget https://iweb.dl.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.26/GraphicsMagick-1.3.26.tar.gz
tar xvf GraphicsMagick-1.3.26.tar.gz
cd GraphicsMagick-1.3.26
./configure
make  
make install

验证环境是否ok:

gm

[root@centos158 ~]# gm
GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2013 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Usage: gm command [options ...]

Where commands include: 
      batch - issue multiple commands in interactive or batch mode
  benchmark - benchmark one of the other commands
    compare - compare two images
  composite - composite images together
    conjure - execute a Magick Scripting Language (MSL) XML script
    convert - convert an image or sequence of images
       help - obtain usage message for named command
   identify - describe an image or image sequence
    mogrify - transform an image or sequence of images
    montage - create a composite image (in a grid) from separate images
       time - time one of the other commands
    version - obtain release version

7.yasm安装

执行:

cd /opt/dong
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install

验证环境是否ok:

yasm --version
[root@centos158 ~]# yasm --version
yasm 1.3.0
Compiled on Jul 16 2018.
Copyright (c) 2001-2014 Peter Johnson and other Yasm developers.
Run yasm --license for licensing overview and summary.

8.libsodium安装

执行:

cd /opt/dong
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.15.tar.gz
tar xvf libsodium-1.0.15.tar.gz
./configure
make
make install

验证环境是否ok:

whereis libsodium

[root@centos158 ~]# whereis libsodium
libsodium: /usr/local/lib/libsodium.so /usr/local/lib/libsodium.la /usr/local/lib/libsodium.a

9.zeromq安装

 

wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
tar zxvf zeromq-4.2.2.tar.gz
cd zeromq-4.2.2
./configure --prefix=/usr/local/zeromq
make
make install

检查:创建了/usr/local/zeromq

配置库

vi /etc/ld.so.conf
#新增一行:
/usr/local/zeromq/lib
ldconfig

10.protobuf安装

cd /opt/dong
wget https://github.com/google/protobuf/releases/download/v3.5.0/protobuf-cpp-3.5.0.tar.gz
tar xvf protobuf-cpp-3.5.0.tar.gz
cd protobuf-3.5.0
./configure --prefix=/usr/local/protobuf
make
make install

配置变量:

vi /etc/profile

在文件中增加如下内容:

export PATH=$PATH:/usr/local/protobuf/bin/
export PKG_CONFIG_PATH=/usr/local/protobuf/lib/pkgconfig/

执行

source profile

验证环境是否ok:

protoc  --version

[root@centos158 ~]# protoc  --version
libprotoc 3.5.0

11.pkg-config安装

cd /opt/dong
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
tar xvf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --prefix=/usr/local/pkg-config --with-internal-glib
make
make install

验证环境是否ok:

pkg-config --version

[root@centos158 ~]# pkg-config --version
0.27.1

12.stf安装

npm install --unsafe-perm --verbose -g stf

下载完成后,进入:

cd /usr/local/node/node-v9.0.0-linux-x64/lib/node_modules/stf/bin
./stf doctor

安装STF_第3张图片

启动rethinkDB

指定端口和缓冲大小启动:rethinkdb --bind all --cache-size 8192 --http-port 8090

[root@centos158 ~]# rethinkdb --bind all --cache-size 8192 --http-port 8090
Running rethinkdb 2.3.6 (GCC 4.8.3)...
Running on Linux 3.10.0-229.el7.x86_64 x86_64
Loading data from directory /root/rethinkdb_data
warn: Cache size is larger than available memory.
Listening for intracluster connections on port 29015
Listening for client driver connections on port 28015
Listening for administrative HTTP connections on port 8090
Listening on cluster addresses: 127.0.0.1, 172.17.0.1, 192.168.100.158, ::1, fe80::42:70ff:fe30:a0d%3, fe80::250:56ff:feaa:1cb8%2, fe80::2cdc:acff:fe1d:c6b8%217, fe80::4c77:c1ff:fe0d:ab86%161, fe80::703f:1fff:fe67:893%155, fe80::acbb:35ff:fef3:61c2%157
Listening on driver addresses: 127.0.0.1, 172.17.0.1, 192.168.100.158, ::1, fe80::42:70ff:fe30:a0d%3, fe80::250:56ff:feaa:1cb8%2, fe80::2cdc:acff:fe1d:c6b8%217, fe80::4c77:c1ff:fe0d:ab86%161, fe80::703f:1fff:fe67:893%155, fe80::acbb:35ff:fef3:61c2%157
Listening on http addresses: 127.0.0.1, 172.17.0.1, 192.168.100.158, ::1, fe80::42:70ff:fe30:a0d%3, fe80::250:56ff:feaa:1cb8%2, fe80::2cdc:acff:fe1d:c6b8%217, fe80::4c77:c1ff:fe0d:ab86%161, fe80::703f:1fff:fe67:893%155, fe80::acbb:35ff:fef3:61c2%157
Server ready, "centos158_h4t" c49e2b5c-a458-49d4-b34d-1406b3e3866a

启动stf

进入stf目录:

cd /usr/local/node/node-v9.0.0-linux-x64/lib/node_modules/stf/bin
./stf local --public-ip 192.168.100.158 --allow-remote  (192.168.100.158位centos服务器地址即stf服务器地址)

在其他地址的电脑上,打开浏览器,输入http://192.168.100.158:7100

安装STF_第4张图片

刚开始没有control

连接windows上的设备

1.手机adb连接上windows

2.本次先杀掉占用5037端口的进程

D:\文档\apk>netstat -ano | findstr "5037"
  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       5708
D:\文档\apk>taskkill /F /PID 5708
成功: 已终止 PID 为 5708 的进程。

3.执行adb nodaemon server -a -P 5037

D:\文档\apk>adb nodaemon server -a -P 5037
adb I 07-18 17:35:58  9748 18480 adb_auth_host.cpp:415] adb_auth_init...
adb I 07-18 17:35:58  9748 18480 adb_auth_host.cpp:173] read_key_file 'C:\Users\dell\.android\adbkey'...
adb I 07-18 17:35:58  9748 18480 adb_auth_host.cpp:466] Calling send_auth_response

4.stf连接设备

cd /usr/local/node/node-v9.0.0-linux-x64/lib/node_modules/stf/bin
./stf provider --name local --min-port 7400 --max-port 7700 --connect-sub tcp://127.0.0.1:7114 --connect-push tcp://127.0.0.1:7116 --group-timeout 20000 --public-ip 192.168.100.158 --storage-url http://192.168.100.158:7100/ --adb-host 192.168.129.173 --adb-port 5037 --vnc-initial-size 720x1280 --allow-remote
public-ip和storage-url指定linux的ip,--adb-host指定windows的ip

参考文档:

https://www.jianshu.com/p/539ee1053da3      --迈阿密小白 

https://testerhome.com/topics/11419   --NJ-zero

转载于:https://www.cnblogs.com/letmeiscool/p/9330652.html

你可能感兴趣的:(移动开发,java,操作系统)