STF (or Smartphone Test Farm) is a web application for debugging smartphones, smartwatches and other gadgets remotely, from the comfort of your browser.
STF was originally developed at CyberAgent to control a growing collection of more than 160 devices. As of July 2016 development is mainly sponsored by HeadSpin and other individual contributors.
We welcome financial contributions in full transparency on our open collective.


Thank you to all our sponsors! (please ask your company to also support this open source project by becoming a sponsor)
HeadSpin provides secure and scalable STF for iOS integrated with Appium/XCTest/Selenium/Espresso, High speed interaction Audio/Video/Game testing and AI based Root cause analysis for Performance Management. It's free to start using HeadSpin in 150+ locations worldwide! Try it out for free.
HeadSpin offers a generous monthly contribution towards STF development.
Thank you to all the people who have already contributed to STF!
Thank you to all our backers! [Become a backer]
Please use our open collective or [contact us][contact-link] directly for sponsor arrangements. Both recurring and one-time contributions are most welcome. Contributions towards a specific issue or feature are also possible, and can be attributed to your company in our release notes and other related materials. Hardware-only contributions, whether new or used, are also extremely helpful and well received, especially if you find a device that doesn't work. Please see our donation transparency report for past hardware contributions.
root is not required for any current functionalityAlt while dragging.apk files
adb connect to connect to a remote device as if it was plugged in to your computer, regardless of ADB mode and whether you're connected to the same network
adb command locally, including shell access[administrator level] to allocate distinct sets of devices to different projects or organizations (i.e. represented by user sets) for an unlimited period[administrator level][administrator level]
[administrator level]
STF is in continued, active development, but development is still largely funded by individual team members and their unpaid free time, leading to slow progress. While normal for many open source projects, STF is quite heavy on the hardware side, and is therefore somewhat of a money sink. See how to become a sponsor if you or your company would like to support future development.
We're also actively working to expand the team, don't be afraid to ask if you're interested.
Here are some things we are planning to address ASAP.
We highly encourage open participation in the community. However, if you're running a business that uses STF or would like to use STF, you may sometimes want to have an expert, i.e. one of the original developers or a skilled contributor, work with you to set up a prototype for evaluation purposes, add support for new or old hardware, figure out an issue, fix a bug or add some new feature. Our services are similar to FFmpeg's. [Contact us][contact-link] with details and we'll see what we can do.
Availability is limited and tied to individual developer's schedules.
As the product has evolved from an internal tool running in our internal network, we have made certain assumptions about the trustworthiness of our users. As such, there is little to no security or encryption between the different processes. Furthermore, devices do not get completely reset between uses, potentially leaving accounts logged in or exposing other sensitive data. This is not an issue for us, as all of our devices are test devices and are only used with test accounts, but it may be an issue for you if you plan on deploying STF to a multiuser environment. We welcome contributions in this area.
Note that you need these dependencies even if you've installed STF directly from NPM, because they can't be included in the package.
On Mac OS, you can use homebrew to install most of the dependencies:
brew install rethinkdb graphicsmagick zeromq protobuf yasm pkg-config
On Windows you're on your own. In theory you might be able to get STF installed via Cygwin or similar, but we've never tried. In principle we will not provide any Windows installation support, but please do send a documentation pull request if you figure out what to do.
We also provide a Docker container in the Docker Hub as openstf/stf. You can use our Dockerfile as guidance if you'd prefer to do the installation yourself.
You should now be ready to build or run STF.
Note that while Mac OS can be used for development, it doesn't provide a very reliable experience in production due to (presumed) bugs in ADB's Mac OS implementation. We use CoreOS but any Linux or BSD distribution should do fine.
As mentioned earlier, you must have all of the requirements installed first. Then you can simply install via NPM:
npm install -g stf
Now you're ready to run. For development, though, you should build instead.
After you've got all the requirements installed, it's time to fetch the rest of the dependencies.
First, fetch all NPM and Bower modules:
npm install
You may also wish to link the module so that you'll be able to access the stf command directly from the command line:
npm link
You should now have a working installation for local development.
STF comprises of several independent processes that must normally be launched separately. In our own setup each one these processes is its own systemd unit. See DEPLOYMENT.md and Setup Examples if you're interested.
For development purposes, however, there's a helper command to quickly launch all required processes along with a mock login implementation. Note that you must have RethinkDB running first.
If you don't have RethinkDB set up yet, to start it up, go to the folder where you'd like RethinkDB to create a rethinkdb_data folder in (perhaps the folder where this repo is) and run the following command:
rethinkdb
Note: if it takes a long time for RethinkDB to start up, you may be running into rethinkdb/rethinkdb#4600 (or rethinkdb/rethinkdb#6047). This usually happens on macOS Sierra. To fix this on macOS, first run scutil --get HostName to check if the HostName variable is unset. RethinkDB needs it to generate a server name for your instance. If you find that it's empty, running sudo scutil --set HostName $(hostname) has been confirmed to fix the issue on at least one occasion. See the issues for more complete solutions.
You should now have RethinkDB running locally. Running the command again in the same folder will reuse the data from the previous session.
An administrator level is available in STF in addition of the native user one, with increased rights on some features (e.g. booking & partitioning systems, management of users & devices, ...). The corresponding built-in administrator user has the following default credentials:
administrator[email protected]Another built-in object exists, this is the root standard group to which the users and devices belong the first time they register to the STF database, its default name is Common
These built-in objects are created in the STF database if they do not already exist
Of course, you can override the default values of these built-in objects by settings the following environment variables before to initialize the STF database through stf local or stf migrate commands:
STF_ROOT_GROUP_NAMESTF_ADMIN_NAMESTF_ADMIN_EMAILYou're now ready to start up STF itself:
stf local
After the webpack build process has finished (which can take a small while) you should have your private STF running on http://localhost:7100. If you had devices connected before running the command, those devices should now be available for use. If not, you should see what went wrong from your console. Feel free to plug in or unplug any devices at any time.
Note that if you see your device ready to use but without a name or a proper image, we're probably missing the data for that model in our device database. Everything should work fine either way.
If you want to access STF from other machines, you can add the --public-ip option for quick testing.
stf local --public-ip <your_internal_network_ip_here>
To update your development version, simply pull the repo and run npm install again. You may occasionally have to remove the whole node_modules and res/bower_components folder to prevent NPM or Bower from complaining about version mismatches.
Yes, see DEPLOYMENT.md and Setup Examples.
No, not all the time. Aside from a single early failure we had within only a few months, all of our devices were doing fine for about two years. However, having reached the 2-3 year mark, several devices have started to experience visibly expanded batteries. Expanded batteries should be replaced as soon as possible. Note that this issue isn't specific to STF, it's just what happens over time. You should be prepared to replace the batteries every now and then. In any case, we consider 2 years per battery pack to be fairly good value for a device lab.
You should set up your devices so that the display is allowed to turn off entirely after a short timeout. 30 seconds or so should do just fine, STF will wake it up when necessary. Otherwise you risk reducing the lifetime of your device.
Note that you may have a problem if your USB hubs are unable to both provide enough power for charging and support a data connection at the same time (data connections require power, too). This can cause a device to stop charging when being used, resulting in many charging cycles. If this happens you will just need to get a better USB hub.
It's possible to run the whole user-facing side behind HTTPS, but that's pretty much it. All internal communication between processes is insecure and unencrypted, which is a problem if you can eavesdrop on the network. See our quick note about security.
Yes and no. See "Is the system secure?". The system has been built in an environment where we are able to trust our users and be confident that they're not going to want to mess with others. In the current incarnation of the system a malicious user with knowledge of the inner workings will, for instance, be able to control any device at any time, whether it is being used by someone or not. Pull requests are welcome.
In our experience the system runs just fine most of the time, and any issues are mostly USB-related. You'll usually have to do something about once a week.
The most common issue is that a device will lose all of its active USB connections momentarily. You'll get errors in the logs but the worker process will either recover or get respawned, requiring no action on your side.
Below are the most common errors that do require manual intervention.
adb reboot manually.When you unplug your device, all STF utilities except STFService stop running automatically. It doesn't do any harm to force stop or uninstall it.
To uninstall the STFService, run the following command:
adb uninstall jp.co.cyberagent.stf
You may also wish to remove our support binaries, although as mentioned before they won't run unless the device is actually connected to STF. You can do this as follows:
adb shell rm /data/local/tmp/minicap \
/data/local/tmp/minicap.so \
/data/local/tmp/minitouch \
/data/local/tmp/minirev
Your device is now clean.
There can be various reasons for this behavior. Some especially common reasons are:
adb start-server.dmesg to check for this errorAgain, there can be various reasons for this behavior as well. Some common reasons are:
adb connect) disconnects while I'm working.If you're using STF locally, the most common cause is that you're not filtering the devices STF is allowed to connect to. The problem is that once you do adb connect, STF sees a new device and tri
Content type
Image
Digest
sha256:b364aaef4…
Size
369.9 MB
Last updated
over 5 years ago
Requires Docker Desktop 4.37.1 or later.