openstf安裝手記


一款基於nodejs+jade模板開發的手機群控框架,你可以在此基礎上拿來測試設備,或者群操作等等。
主要核心技術在於如何在不root的情況下實時流暢錄屏,以及遠程操作手機。

官方git
https://github.com/openstf/stf

安裝環境

虛擬機:centos7
鏡像源:yum阿里雲鏡像(http://mirrors.aliyun.com/

軟件安裝

前提是一件安裝好了nodejs環境,然后執行簡單的命令即可

 
 
 
         
  1. 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/

 
 
 
         
  1. sudo wget http://download.rethinkdb.com/centos/7/`uname -m`/rethinkdb.repo \
  2. -O /etc/yum.repos.d/rethinkdb.repo
  3. 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

 
 
 
         
  1. tar -xf GraphicsMagick-1.3.18.tar.gz
  2. cd GraphicsMagick-1.3.18
  3. #如果上面的庫都是yes,no的不支持,想支持自行yum,就沒有問題了
  4. ./configure --prefix=/usr/local/GraphicsMagick --enable-shared
  5. make && make install
  6. #這些都是典型的使用GNU的AUTOCONF和AUTOMAKE產生的程序的安裝步驟。
  7. #./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 察看詳細的說明幫助。
  8. #make是用來編譯的,它從Makefile中讀取指令,然后編譯。
  9. #make install是用來安裝的,它也從Makefile中讀取指令,安裝到指定的位置。

添加到環境變量

 
 
 
         
  1. vim /etc/profile.d/path.sh
  2. #添加一行
  3. export PATH=$PATH:/usr/local/GraphicsMagick/bin

重啟即可
gm

zeromq

輕量級消息隊列內核
有點大
http://zeromq.org/intro:get-the-software

 
 
 
         
  1. git clone https://github.com/zeromq/libzmq
  2. ./autogen.sh && ./configure && make -j 4
  3. 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.

安裝完成后

 
 
 
         
  1. Libraries have been installed in:
  2. /usr/local/lib
  3. If you ever happen to want to link against installed libraries
  4. in a given directory, LIBDIR, you must either use libtool, and
  5. specify the full pathname of the library, or use the `-LLIBDIR'
  6. flag during linking and do at least one of the following:
  7. - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  8. during execution
  9. - add LIBDIR to the `LD_RUN_PATH' environment variable
  10. during linking
  11. - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  12. - have your system administrator add LIBDIR to `/etc/ld.so.conf'
  13. See any operating system documentation about shared libraries for
  14. 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

 
 
 
         
  1. wget https://github.com/google/protobuf/releases/download/v3.0.2/protobuf-cpp-3.0.2.tar.gz
  2. tar -xvf
  3. ./configure
  4. make #編譯時間好久
  5. make check
  6. sudo make install
  7. 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格式。
看到這用到匯編我就哭了

 
 
 
         
  1. wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
  2. tar -xf yasm-1.3.0.tar.gz
  3. ./configure
  4. make
  5. make install

運行

 
 
 
         
  1. rethinkdb
  2. stf local
  3. 在瀏覽器中輸入地址:http://localhost:7100/ 訪問客戶端。
  4. 如果要遠程調試,stf local --public-ip 192.168.153.129 --allow-remote
  5. 有些包沒安裝報錯
  6. cd /usr/local/lib/node_modules/stf/
  7. npm install

其他

各種運行報錯,檢查錯誤,然后修復即可
包括http://phantomjs.org/download.html
這個插件的安裝,環境變量的添加

npm install jpeg-turbo


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM