一款基於nodejs+jade模板開發的手機群控框架,你可以在此基礎上拿來測試設備,或者群操作等等。
主要核心技術在於如何在不root的情況下實時流暢錄屏,以及遠程操作手機。
官方git
https://github.com/openstf/stf
軟件安裝
環境安裝
ADB
RethinkDB
GraphicsMagick
zeromq
Protocol Buffers
yasm(for compiling embedded libjpeg-turbo)
運行
其他
安裝環境
虛擬機:centos7
鏡像源:yum阿里雲鏡像(http://mirrors.aliyun.com/)
軟件安裝
前提是一件安裝好了nodejs環境,然后執行簡單的命令即可
npm install -g stf
光安裝軟件是無法運行的,下面還要安裝各種依賴。
環境安裝
包括
- Node.js >= 0.12
- ADB properly set up
- RethinkDB >= 2.2
- GraphicsMagick (for resizing screenshots)
- ZeroMQ libraries installed
- Protocol Buffers libraries installed
- yasm installed (for compiling embedded libjpeg-turbo)
- pkg-config so that Node.js can find the libraries
ADB
ADB+Android SDK去騰訊鏡像下載
http://android-mirror.bugly.qq.com:8080/include/usage.html
用winscp復制下載文件到linux系統,我選擇路徑為/opt/
unzip或tar命令解壓即可。
先解壓sdk,生成android-sdk-linux目錄,再把platform-tools_r24.0.3-linux移到目錄里,解壓
設置環境變量
創建文件
cd /etc/profile.d
touch path.sh
vim path.sh
保存內容
export ANDROID_HOME=/opt//android-sdk-linux
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
重啟機器
adb
RethinkDB
據說完美支持SSD的nosql
https://rethinkdb.com/docs/install/centos/
sudo wget http://download.rethinkdb.com/centos/7/`uname -m`/rethinkdb.repo \
-O /etc/yum.repos.d/rethinkdb.repo
sudo yum install rethinkdb
GraphicsMagick
圖片處理瑞士軍刀
安裝各種庫
主要是下面三個,如果還想支持別的圖片,自行yum
FreeType 2.0 –with-ttf=yes no (需要freetype支持)
JPEG v1 –with-jpeg=yes no (需要libjpeg支持)
PNG –with-png=yes no (需要libpng支持)
下載安裝
http://www.graphicsmagick.org/download.html
tar -xf GraphicsMagick-1.3.18.tar.gz
cd GraphicsMagick-1.3.18
#如果上面的庫都是yes,no的不支持,想支持自行yum,就沒有問題了
./configure --prefix=/usr/local/GraphicsMagick --enable-shared
make && make install
#這些都是典型的使用GNU的AUTOCONF和AUTOMAKE產生的程序的安裝步驟。
#./configure是用來檢測你的安裝平台的目標特征的。比如它會檢測你是不是有CC或GCC,並不是需要CC或GCC,它是個shell腳本。configure,這一步一般用來#生成 Makefile,為下一步的編譯做准備,你可以通過在 configure 后加上參數來對安裝進行控制,比如代碼:./configure –prefix=/usr 意思是將該軟件安裝在 /usr 下#面,執行文件就會安裝在 /usr/bin (而不是默認的 /usr/local/bin),資源文件就會安裝在 /usr/share(而不是默認的/usr/local/share)。同時一些軟件的配置文件你#可以通過指定 –sys-config= 參數進行設定。有一些軟件還可以加上 –with、–enable、–without、–disable 等等參數對編譯加以控制,你可以通過允許 ./configure –#help 察看詳細的說明幫助。
#make是用來編譯的,它從Makefile中讀取指令,然后編譯。
#make install是用來安裝的,它也從Makefile中讀取指令,安裝到指定的位置。
添加到環境變量
vim /etc/profile.d/path.sh
#添加一行
export PATH=$PATH:/usr/local/GraphicsMagick/bin
重啟即可
gm
zeromq
輕量級消息隊列內核
有點大
http://zeromq.org/intro:get-the-software
git clone https://github.com/zeromq/libzmq
./autogen.sh && ./configure && make -j 4
make check && make install && sudo ldconfig
安裝過程遇到一個test fail,我懷疑是官方搞錯了,跳過check,直接安裝吧
git貌似不好使,所以還是下載安裝包
To build on UNIX-like systems
If you have free choice, the most comfortable OS for developing with ZeroMQ is probably Ubuntu.
Make sure that libtool, pkg-config, build-essential, autoconf, and automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
To install ZeroMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ZeroMQ.
To see configuration options, run ./configure –help. Read INSTALL for more details.
安裝完成后
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
這是告訴你接下來要怎么用。簡單的辦法是在 /etc/ld.so.conf.d 下新建一個文件 local.conf,里邊寫上 /usr/local/lib。然后以 root 權限執行 ldconfig。這樣你的系統才會找得到安裝到 /usr/local/lib 下的庫文件。
Protocol Buffers
https://github.com/google/protobuf/releases
google的存儲格式協議,類似json
wget https://github.com/google/protobuf/releases/download/v3.0.2/protobuf-cpp-3.0.2.tar.gz
tar -xvf
./configure
make #編譯時間好久
make check
sudo make install
sudo ldconfig # refresh shared library cache.
protoc –version
yasm(for compiling embedded libjpeg-turbo)
Yasm是一個完全重寫的NASM匯編。目前,它支持x86和AMD64指令集,接受NASM和GNU匯編器(gas)語法,產出二進制, ELF32 , ELF64 , COFF , Mach - O的( 32和64 ) , RDOFF2 ,的Win32和Win64對象的格式,並生成STABS 調試信息的來源,DWARF 2 ,CodeView 8格式。
看到這用到匯編我就哭了
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xf yasm-1.3.0.tar.gz
./configure
make
make install
運行
rethinkdb
stf local
在瀏覽器中輸入地址:http://localhost:7100/ 訪問客戶端。
如果要遠程調試,stf local --public-ip 192.168.153.129 --allow-remote
有些包沒安裝報錯
cd /usr/local/lib/node_modules/stf/
npm install
其他
各種運行報錯,檢查錯誤,然后修復即可
包括http://phantomjs.org/download.html
這個插件的安裝,環境變量的添加
npm install jpeg-turbo