Using STF to Manage Cloud Phones in Batches
Scenarios
Smartphone Test Farm (STF) is an open-source web-based application used for managing and controlling mobile devices. STF uses a browser to control and manage Android devices, enabling you to use, debug, and test those devices on the cloud. This section describes how to deploy STF components on an ECS to manage cloud phones in batches.
Restrictions and Limitations
- STF can manage about 160 cloud phones at the same time. For larger-scale access management, secondary development is required.
- STF needs a stable network to run smoothly. When the network status is poor, the operation latency of cloud phones increases significantly.
Prerequisites
- A cloud phone server that has an EIP bound is available.
- An ECS that has an EIP bound is available.
- Cloud phone server: physical.kg1.4xlarge.cp | kg1.cp.c60.d16SSD.e1v1
- ECS: general computing | s6.large.2 | 2 vCPUs | 4 GiB | Ubuntu 18.04 server 64bit (40 GB)
Procedure
Deploy components on which STF depends on the ECS, use the ADB tool to connect to the cloud phone, and access the STF address through a browser to manage cloud phones in batches.
- Install ADB and check the installation result.
sudo apt install android-tools-adb android-tools-fastboot adb --version
If --version is displayed, the installation is successful.
Figure 1 Successful installation of ADB
- Update the yum source and install RethinkDB to store STF data.
source /etc/lsb-release && echo "deb https://download.rethinkdb.com/repository/ubuntu-$DISTRIB_CODENAME $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg | sudo apt-key add - sudo apt-get update sudo apt-get install rethinkdb rethinkdb -v
If -v is displayed, the installation is successful.Figure 2 Successful installation of RethinkDB
RethinkDB provides official support for the x86 architecture while experimental support for the Arm architecture.
- Install ZeroMQ to transfer messages.
sudo apt-get install libzmq3-dev
Figure 3 Successful installation of ZeroMQ
- Install Protocol Buffers as the data format for message transfer.
sudo apt-get install libprotobuf-dev protobuf-compiler protoc --version
If --version is displayed, the installation is successful.Figure 4 Successful installation of Protocol Buffers
- Install GraphicsMagick to read, write, and operate pictures.
sudo apt-get install graphicsmagick gm version
If version is displayed, the installation is successful.Figure 5 Successful installation of GraphicsMagick
- Install pkg-config to compile the third-party library of Nodejs.
sudo apt-get install pkg-config pkg-config --version
If --version is displayed, the installation is successful.Figure 6 Successful installation of pkg-config
- Install yasm to compile dependent libraries of STF.
sudo apt-get install yasm yasm --version
If --version is displayed, the installation is successful.Figure 7 Successful installation of yasm
- Install Nodejs to deploy the STF runtime environment.
##STF supports only Node.js 8.x. curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs node -v npm -v
If -v is displayed, the installation is successful.Figure 8 Successful installation of node and npm
- Install STF.
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org sudo cnpm install -g stf stf -V
If -V is displayed, the installation is successful.Figure 9 Successful installation of STF
- Check whether the environment on which STF depends is available.
stf doctor
If the version of each component is displayed in the command output, the environment is available.Figure 10 Checking the STF startup environment
- Use ADB to connect to the cloud phone. For details, see ADB (Internet).
- Start RethinkDB.
rethinkdb
If information similar to that in the following is displayed, RethinkDB is started successfully.Figure 11 Starting RethinkDB
- Start STF in local mode and access STF using a browser.
## Set EIP to the EIP bound to the ECS. stf local --public-ip {EIP} --allow-remote ## Access method http://{EIP}:7100/
Figure 12 Entering the default username and password of STF
Figure 13 Cloud phones
Figure 14 Cloud phone Control screen
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot