stf-master

所属分类:其他
开发工具:JavaScript
文件大小:4683KB
下载次数:7
上传日期:2018-06-04 10:45:27
上 传 者张远瞩
说明:  云手机操作系统,STF开源源代码,云技术
(Cloud mobile operating system, STF, welcome Downloads)

文件列表:
.bowerrc (42, 2018-05-09)
.dockerignore (140, 2018-05-09)
.editorconfig (175, 2018-05-09)
.eslintrc (8017, 2018-05-09)
.npmignore (334, 2018-05-09)
.travis.yml (1577, 2018-05-09)
.tx (0, 2018-05-09)
.tx\config (166, 2018-05-09)
CHANGELOG.md (11098, 2018-05-09)
CONTRIBUTING.md (1305, 2018-05-09)
DONATION-TRANSPARENCY.md (970, 2018-05-09)
Dockerfile (2105, 2018-05-09)
ISSUE_TEMPLATE.md (498, 2018-05-09)
LICENSE (598, 2018-05-09)
TESTING.md (465, 2018-05-09)
bin (0, 2018-05-09)
bin\stf (49, 2018-05-09)
bower.json (1496, 2018-05-09)
doc (0, 2018-05-09)
doc\7s_usage.gif (631949, 2018-05-09)
doc\API.md (13241, 2018-05-09)
doc\DEPLOYMENT.md (41529, 2018-05-09)
doc\VNC.md (2056, 2018-05-09)
doc\WHY.md (509, 2018-05-09)
doc\shelf_closeup_790x.jpg (45934, 2018-05-09)
doc\sponsors (0, 2018-05-09)
doc\sponsors\headspin-wordmark-orange.png (7813, 2018-05-09)
doc\topo-v1.ditaa (4293, 2018-05-09)
doc\topo-v1.png (32820, 2018-05-09)
docker (0, 2018-05-09)
docker\armv7l (0, 2018-05-09)
docker\armv7l\Dockerfile (2376, 2018-05-09)
docker\armv7l\mkimage-alpine.sh (1747, 2018-05-09)
docker\armv7l\stf-armv7l-baseimage@.service (487, 2018-05-09)
docker\armv7l\stf-armv7l-build@.service (370, 2018-05-09)
docker\armv7l\stf-armv7l-clone@.service (297, 2018-05-09)
... ...

STF [![Build Status](https://travis-ci.org/openstf/stf.svg?branch=master)](https://travis-ci.org/openstf/stf) [![Docker Pulls](https://img.shields.io/docker/pulls/openstf/stf.svg)](https://hub.docker.com/r/openstf/stf/) [![NPM version](https://img.shields.io/npm/v/stf.svg)](https://www.npmjs.com/package/stf) **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](https://www.cyberagent.co.jp/en/) to control a growing collection of more than 160 devices. As of July 2016 development is mainly sponsored by [HeadSpin](https://performance.headspin.io/) and [other individual contributors](https://www.bountysource.com/teams/openstf). Please visit [our BountySource](https://salt.bountysource.com/teams/openstf) if you'd like to support future development. How are your donations being used? Check out our [donation transparency report](DONATION-TRANSPARENCY.md). ![Close-up of device shelf](doc/shelf_closeup_790x.jpg?raw=true) ![Super short screencast showing usage](doc/7s_usage.gif?raw=true) ## Sponsors ### Gold Sponsor [HeadSpin](https://performance.headspin.io/) > [HeadSpin](https://performance.headspin.io/) enables developers launch high quality and high performing apps Worldwide. Using HeadSpin’s global distributed device cloud infrastructure, developers can test and monitor their apps instantly on 1,500 global cell networks and local devices. HeadSpin seamlessly plugs into your development workflow with no code changes to your apps. HeadSpin offers a generous monthly contribution towards STF development. ### How to become a sponsor Please [contact us][contact-link] 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](DONATION-TRANSPARENCY.md) for past hardware contributions. ## Features * OS support - Android * Supports versions 2.3.3 (SDK level 10) to 8.1 (SDK level 27) * Supports Wear 5.1 (but not 5.0 due to missing permissions) * Supports Fire OS, CyanogenMod, and other heavily Android based distributions * `root` is **not** required for any current functionality * Remote control any device from your browser - Real-time screen view * Refresh speed can reach 30-40 FPS depending on specs and Android version. See [minicap](https://github.com/openstf/minicap) for more information. * Rotation support - Supports typing text from your own keyboard * Supports meta keys * Copy and paste support (although it can be a bit finicky on older devices, you may need to long-press and select paste manually) * May sometimes not work well with non-Latin languages unfortunately. - Multitouch support on touch screens via [minitouch](https://github.com/openstf/minitouch), two finger pinch/rotate/zoom gesture support on regular screens by pressing `Alt` while dragging - Drag & drop installation and launching of `.apk` files * Launches main launcher activity if specified in the manifest - Reverse port forwarding via [minirev](https://github.com/openstf/minirev) * Access your local server directly from the device, even if it's not on the same network - Open websites easily in any browser * Installed browsers are detected in real time and shown as selectable options * Default browser is detected automatically if selected by the user - Execute shell commands and see real-time output - Display and filter device logs - Use `adb connect` to connect to a remote device as if it was plugged in to your computer, regardless of [ADB](http://developer.android.com/tools/help/adb.html) mode and whether you're connected to the same network * Run any `adb` command locally, including shell access * [Android Studio](http://developer.android.com/tools/studio/index.html) and other IDE support, debug your app while watching the device screen on your browser * Supports [Chrome remote debug tools](https://developer.chrome.com/devtools/docs/remote-debugging) - File Explorer to access device file system - Experimental VNC support (work in progress) * Manage your device inventory - See which devices are connected, offline/unavailable (indicating a weak USB connection), unauthorized or unplugged - See who's using a device - Search devices by phone number, IMEI, ICCID, Android version, operator, product name and/or many other attributes with easy but powerful queries - Show a bright red screen with identifying information on a device you need to locate physically - Track battery level and health - Rudimentary Play Store account management * List, remove and add new accounts (adding may not work on all devices) - Display hardware specs * Simple REST [API](doc/API.md) ## Status 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](#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. ### Short term goals Here are some things we are planning to address ASAP. 1. Performance 2. Properly expose the new VNC functionality in the UI 3. Properly reset user data between uses (Android 4.0+) 4. Automated scheduled restarts for devices 5. More! ### Consulting services 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](https://ffmpeg.org/consulting.html). [Contact us][contact-link] with details and we'll see what we can do. Availability is limited and tied to individual developer's schedules. ## A quick note about security 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. ## Requirements * [Node.js](https://nodejs.org/) >= 6.9 (latest stable version preferred) * [ADB](http://developer.android.com/tools/help/adb.html) properly set up * [RethinkDB](http://rethinkdb.com/) >= 2.2 * [GraphicsMagick](http://www.graphicsmagick.org/) (for resizing screenshots) * [ZeroMQ](http://zeromq.org/) libraries installed * [Protocol Buffers](https://github.com/google/protobuf) libraries installed * [yasm](http://yasm.tortall.net/) installed (for compiling embedded [libjpeg-turbo](https://github.com/sorccu/node-jpeg-turbo)) * [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/) so that Node.js can find the libraries Note that you need these dependencies even if you've installed STF directly from [NPM](https://www.npmjs.com/), because they can't be included in the package. On Mac OS, you can use [homebrew](http://brew.sh/) to install most of the dependencies: ```bash 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](https://www.cygwin.com/) 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](http://docker.com/) container in the [Docker Hub](https://hub.docker.com/) as [openstf/stf](https://registry.hub.docker.com/u/openstf/stf/). You can use our [Dockerfile](Dockerfile) as guidance if you'd prefer to do the installation yourself. You should now be ready to [build](#building) or [run](#running) 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](https://coreos.com/) but any Linux or BSD distribution should do fine. ## Installation As mentioned earlier, you must have all of the [requirements](#requirements) installed first. Then you can simply install via NPM: ```bash npm install -g stf ``` Now you're ready to [run](#running). For development, though, you should [build](#building) instead. ## Building After you've got all the [requirements](#requirements) installed, it's time to fetch the rest of the dependencies. First, fetch all NPM and Bower modules: ```bash 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: ```bash npm link ``` You should now have a working installation for local development. ## Running STF comprises of several independent processes that must normally be launched separately. In our own setup each one these processes is its own [systemd](http://www.freedesktop.org/wiki/Software/systemd/) unit. See [DEPLOYMENT.md](doc/DEPLOYMENT.md) and [Setup Examples](https://github.com/openstf/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: ```bash rethinkdb ``` _Note: if it takes a long time for RethinkDB to start up, you may be running into [rethinkdb/rethinkdb#4600](https://github.com/rethinkdb/rethinkdb/issues/4600) (or [rethinkdb/rethinkdb#6047](https://github.com/rethinkdb/rethinkdb/issues/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. You're now ready to start up STF itself: ```bash stf local ``` After the [webpack](http://webpack.github.io/) build process has finished (which can take a small while) you should have your private STF running on [http://localhost:7100](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](https://github.com/openstf/stf-device-db). 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. ```bash stf local --public-ip ``` ## Updating 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. ## FAQ ### Can I deploy STF to actual servers? Yes, see [DEPLOYMENT.md](doc/DEPLOYMENT.md) and [Setup Examples](https://github.com/openstf/setup-examples). ### Will I have to change battery packs all the time? 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](#recommended-hardware). ### Is the system secure? 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](#a-quick-note-about-security). ### Can I just put the system online, put a few devices there and start selling it? Yes and no. See "[Is the system secure?](#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. ### Once I've got the system running, can I pretty much leave it like that or is manual intervention required? 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. * One device worker keeps getting respawned all the time - Rebooting the device usually helps. If the device stays online for long enough you might be able to do it from the UI. Otherwise you'll have to SSH into the server and run `adb reboot` manually. - This could be a sign that you're having USB problems, and the device wishes to be moved elsewhere. The less complex your setup is the fewer problems you're going to experience. See [troubleshooting](#troubleshooting). - We're working on adding periodic automatic restarts and better graceful recovery to alleviate the issue. * A whole group of devices keeps dying at once - They're most likely connected to the same USB hub. Either the hub is bad or you have other compatibility issues. In our experience this usually happens with USB 3.0 hubs, or you may have a problem with your USB extension card. See [recommended hardware](#recommended-hardware). * A device that should be online is not showing up in the list or is showing up as disconnected - See [troubleshooting](#troubleshooting). ### How do I uninstall STF from my device? 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: ```bash 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: ```bash 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. ## Troubleshooting ### I plugged in a new device but it's not showing up in the list. There can be various reasons for this behavior. Some especially common reasons are: * USB debugging is not enabled - Enable it. * USB debugging is enabled but the USB connection mode is wrong - Try switching between MTP and PTP modes and see if the device appears. This happens fairly often on Mac OS but almost never on Linux. * You don't have the ADB daemon running - Make sure ADB is running with `adb start-server`. * You haven't authorized the ADB key yet - Check your device for an authentication dialog. You may need to unplug and then plug the device back in to see the dialog. * ADB hasn't whitelisted the manufacturer's vendor ID - [Add it yourself](https://github.com/apkudo/adbusbini) or wait for the new version that removes the stupid whitelisting feature to be deployed. * Insufficient power supply - If you're using a USB hub, try a [powered hub](#recommended-hardware) instead (one that comes with a separate AC adapter). - Even if you're using a powered hub, there might not actually be enough power for all ports simultaneously. [Get a better hub](#recommended-hardware) or use fewer ports. - Your device is too power hungry, can happen with tablets. [Get a better hub](#recommended-hardware). * Insufficient USB host controller resources - On Linux, use `dmesg` to check for this error - If you've only got 9-12 devices connected and an Intel (Haswell) processor, it's most likely an issue with the processor. If your BIOS has an option to disable USB 3.0, that might help. If not, you're screwed and must get a PCIE extension card with onboard controllers. * Your powered USB hub does not support the device - Can happen with older devices and newer Battery Charging spec compatible hubs. [Get a more compatible hub](#recommended-hardware). * The USB cable is bad - It happens. Try another one. * The USB hub is broken - This, too, happens. Just try a new one. * The device might not have a unique USB serial number, causing STF to overwrite the other device instead - This has never happened to us so far, but we do have one dirt-cheap Android 4.4 device whose serial number is the wonderfully unique "0123456789ABCDEF". Presumably if we had more than one unit we would have a problem. ### A device that was previously connected no longer shows up in the list. Again, there can be various reasons for this behavior as well. Some common reasons are: * The device ran out of power - You can see the last reported power level in the device lis ... ...

近期下载者

相关文件


收藏者