Giter Club home page Giter Club logo

stf's Introduction

Warning

This project along with other ones in OpenSTF organisation is provided as is for community, without active development.

You can check any other forks that may be actively developed and offer new/different features here.

Active development has been moved to DeviceFarmer organisation. Version 3.4.2 is the last release of OpenSTF on DockerHub and 3.4.1 on npmjs.

STF

Build Status Docker Pulls NPM version Backers on Open Collective Sponsors on Open Collective

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.

Close-up of device shelf

Super short screencast showing usage

Credits

Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by becoming a sponsor)

Gold Sponsor

HeadSpin

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.

Contributors

Thank you to all the people who have already contributed to STF!

Backers

Thank you to all our backers! [Become a backer]

How to become a sponsor

Please use our open collective or contact us 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.

Features

  • OS support
    • Android
      • Supports versions 2.3.3 (SDK level 10) to 9.0 (SDK level 28)
      • 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 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, 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
      • 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 mode and whether you're connected to the same network
    • File Explorer to access device file system
    • Experimental VNC support (work in progress)
  • Monitor 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, group 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
  • Use the Booking & Partitioning systems
    • Overview
      • The partitioning system allow you [administrator level] to allocate distinct sets of devices to different projects or organizations (i.e. represented by user sets) for an unlimited period
      • The booking system allows you to reserve a set of devices for a set of users during a limited time (e.g. from 3:00 am to 4:00 am during 5 days)
      • What is common to the booking & partitioning systems is the concept of Group, that is, an association of devices, users and a specification of time
      • Report to GroupFeature.pdf for detailed documentation on how to use this feature
    • Monitor your group inventory
      • See which groups are active, ready or pending, as well as other group properties: name, identifier, owner, devices, users, class, duration, repetition, starting date, expiration date
      • Search groups by their property values
      • Contact by email the owners of the selected groups
    • Manage your groups
      • Create a group by specifying its name, devices, users and schedule
      • Get ready your group in order it is scheduled by the system
      • Search groups by their property values
      • Remove your group or a selection of your groups
      • Contact by email the owners of the selected groups [administrator level]
  • Manage the devices [administrator level]
    • Search the devices by their property values
    • Remove a device or a selection of devices meeting a set of filters: present, booked, annotated, controlled
  • Manage the users [administrator level]
    • Create a user by providing his name and his email
    • Search the users by their property values
    • Remove a user or a selection of users meeting a set of filters: group owner
    • Contact a user or a selection of users by email
    • Set the default groups quotas applicable to all users
    • Set the groups quotas applicable to a specific user
  • Simple REST API

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 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. Contact us 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

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.

Installation

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.

Building

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.

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 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:

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:

  • root standard group name: STF_ROOT_GROUP_NAME
  • administrator user name: STF_ADMIN_NAME
  • administrator user email: STF_ADMIN_EMAIL

You'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>

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 and 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.

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.

Can I just put the system online, put a few devices there and start selling it?

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.

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.
    • 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.
  • A device that should be online is not showing up in the list or is showing up as disconnected

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:

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.

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 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 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 or use fewer ports.
    • Your device is too power hungry, can happen with tablets. Get a better hub.
  • 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
  • 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 list, unless there was a lengthy power outage preventing the battery level from being reported.
  • Someone accidentally disabled USB debugging remotely
    • Yes, it happens.
  • An OS update disabled USB debugging
    • Yes, it happens. Especially on Fire OS.
  • Someone touched the USB cable just the wrong way causing a disconnection
    • Happens easily.
  • Your PCIE USB extension card died
    • Yes, it happens.
  • Temporary network issues
    • Can't help with that.
  • Someone removed the device physically.
    • Or that.
  • You're on Mac OS
    • There's a bug in ADB's Mac OS implementation that causes devices to be lost on error conditions. The problem is more pronounced when using USB hubs. You have to unplug and then plug it back in again.
  • The USB hub broke
    • Happens. Just try a new one.

Remote debugging (i.e. 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 tries to set it up. Unfortunately since it's already connected via USB, setting up the new device causes the worker process handling the original USB device to fail. This is not a problem in production, since the devices should be connected to an entirely different machine anyway. For development it's a bit inconvenient. What you can do is give stf local a list of serials you wish to use. For example, if your device's serial is 0123456789ABCDEF, use stf local 0123456789ABCDEF. Now you can use adb connect and STF will ignore the new device.

There's another likely cause if you're running STF locally. Even if you whitelist devices by serial in STF, your IDE (e.g. Android Studio) doesn't know anything about that. From the IDE's point of view, you have two devices connected. When you try to run or debug your application, Android Studio suddenly notices that two devices are now providing JDWP connections and tries to connect to them both. This doesn't really work since the debugger will only allow one simultaneous connection, which causes problems with ADB. It then decides to disconnect the device (or sometimes itself) entirely.

One more sad possibility is that your Android Studio likes to restart ADB behind the scenes. Even if you restart ADB, USB devices will soon reappear as they're still connected. The same is not true for remote devices, as ADB never stores the list anywhere. This can sometimes also happen with the Android Device Monitor (monitor).

Recommended hardware

This is a list of components we are currently using and are proven to work.

PC components

These components are for the PC where the USB devices are connected. Our operating system of choice is CoreOS, but any other Linux or BSD distribution should do fine. Be sure to use reasonably recent kernels, though, as they often include improvements for the USB subsystem.

Our currently favorite build is as follows. It will be able to provide 28 devices using powered USB hubs, and about 10 more if you're willing to use the motherboard's USB ports, which is usually not recommended for stability reasons. Note that our component selection is somewhat limited by their availability in Japan.

Component Recommendation How many
PC case XIGMATEK Nebula x1
Motherboard ASUS H97I-PLUS x1
Processor Intelยฎ Coreโ„ข i5-4460 x1
PSU Corsair CX Seriesโ„ข Modular CX430M ATX Power Supply x1
Memory Your favorite DDR3 1600 MHz 8GB stick x1
SSD A-DATA Premier Pro SP900 64GB SSD x1
USB extension card StarTech.com 4 Port PCI Express (PCIe) SuperSpeed USB 3.0 Card Adapter w/ 4 Dedicated 5Gbps Channels - UASP - SATA / LP4 Power x1
USB hub Plugable USB 2.0 7 Port Hub with 60W Power Adapter x4
MicroUSB cable Monoprice.com 1.5ft USB 2.0 A Male to Micro 5pin Male 28/24AWG Cable w/ Ferrite Core (Gold Plated) x28

You may also need extension cords for power.

Alternatively, if you find that some of your older devices do not support the recommended hub, you may wish to mix the hub selection as follows:

Component Recommendation How many
USB hub Plugable USB 2.0 7 Port Hub with 60W Power Adapter x2
USB hub for older devices System TALKS USB2-HUB4XA-BK x2-4

You can connect up to two of the older hubs (providing up to 8 devices total) directly to the motherboard without exhausting USB host controller resources.

We also have several "budget builds" with an MSI AM1I motherboard and an AMD Athlon 5350 4-core processor. These builds, while significantly cheaper, sometimes completely lose the USB PCIE extension cards, and even a reboot will not always fix it. This may normally be fixable via BIOS USB settings, but unfortunately the budget motherboard has a complete lack of any useful options. Fortunately the AMD processor does not share Intel's Haswell USB host control resource problem, so you can also just connect your hubs to the motherboard directly if you don't mind sharing the root bus.

Below is an incomplete list of some of the components we have tried so far, including unsuitable ones.

Tested equipment

Note that our hardware score ratings only reflect their use for the purposes of this project, and are not an overall statement about the quality of the product.

USB extension cards
Name Score Short explanation
StarTech.com 4 Port PCI Express (PCIe) SuperSpeed USB 3.0 Card Adapter w/ 4 Dedicated 5Gbps Channels - UASP - SATA / LP4 Power 9/10 Reliable, well supported chipset and good power connections
StarTech.com 4 Independent Port PCI Express USB 2.0 Adapter Card 8/10 Reliable
็Ž„ไบบๅฟ—ๅ‘ USB3.0RX4-P4-PCIE 4/10 Well supported chipset but breaks VERY easily

Our current recommendation is StarTech.com's PEXUSB3S44V. It provides an independent Renesas (allegedly Linux-friendliest) ยตPD720202 host controller for each port. Another option from the same maker is PEXUSB400, which also works great but may offer slightly less future proofing.

Our ็Ž„ไบบๅฟ—ๅ‘ USB3.0RX4-P4-PCIE cards have been nothing but trouble and we've mostly phased them out by now. Chipset-wise it's pretty much the same thing as StarTech's offering, but the SATA power connector is awfully flimsy and can actually physically break off. The card is also incredibly sensitive to static electricity and will permanently brick itself, which happened on numerous occasions.

USB hubs
Name Score Short explanation
Plugable USB 2.0 7 Port Hub with 60W Power Adapter 8/10 High power output, high reliability
Plugable USB 3.0 7-port Charging Hub with 60W Power Adapter 5/10 High power output, low reliability
System TALKS USB2-HUB4XA-BK USB 2.0 hub with power adapter 7/10 High power output on two ports which complicates device positioning, low port count
Anker USB 3.0 9-Port Hub + 5V 2.1A Charging Port 2/10 High port count, insufficient power
ORICO P10-U2 External ABS 10 Port 2.0 USB HUB for Laptop/Desktop-BLACK 3/10 High port count, insufficient power
ORICO BH4-U3-BK ABS 4 Port USB3.0 BC1.2 Charging HUB with 12V3A Power Adapter-BLACK 5/10 High power output, low reliability

The best hub we've found so far is Plugable's USB 2.0 7 Port Hub with 60W Power Adapter. It's able to provide 1.5A per port for Battery Charging spec compliant devices, which is enough to both charge and sync even tablets (although charging will not occur at maximum speed, but that's irrelevant to us). Note that even devices that are not compliant will usually charge and sync just fine, albeit slower. The more recent USB 3.0 version has proven unreliable with the rest of our components, causing the whole hub to disconnect at times. Annoyingly the ports face the opposite direction, too. Note that ORICO also provides hubs that are identical to Plugable's offerings, the latter of which seem to be rebrands.

Unfortunately Plugable's USB 2.0 hub is not perfect either, at least for our purposes. It includes a physical on/off switch which can be especially annoying if your devices are in a regular office with occasional scheduled power outages. This will shut down the PC too, of course, but the problem is that once power comes back online, the hubs will be unable to switch themselves on and the devices won't charge, leading you to find a bunch of dead devices the next Monday.

The System TALKS USB 2.0 hub is very reliable, but has a few annoying drawbacks. First, the power adapter only provides power to two of its four ports, while the other two are powered by the host PC. The problem with this approach is that you must figure out which devices are power hungry yourself and put them on the ports with higher current. This can complicate device setup/positioning quite a bit. Another drawback is that if the host PC is turned off, only the powered ports will keep charging the connected devices. However, the hub is amazingly compatible with pretty much anything, making it the top choice for older devices that do not support the Battery Charging hubs.

Most powered USB 3.0 hubs we've tested have had a serious problem: the whole hub occasionally disconnected. This may have been caused by the specific combination of our components and/or OS, but as of yet we don't really know. Disabling USB 3.0 may help if you run into the same problem.

Translating

Currently STF UI is available in English and Japanese.

If you would like translate to any other language, please contribute in the STF Transifex project.

For updating the source and all the translation files first you have to install the Transifex client.

Then just run:

gulp translate

It will do the following:

  1. Convert all the jade files to html.
  2. Extract with gettext all translatable strings to stf.pot.
  3. Push stf.pot to Transifex.
  4. Pull from Transifex all po translations.
  5. Compile all po files to json.

Then in order to add it officially (only needs to be done once):

  1. Add the language to res/common/lang/langs.json.
  2. Pull the specific language tx pull -l <lang>.
  3. Run gulp translate.

Testing

See TESTING.md.

Contributing

See CONTRIBUTING.md.

License

See LICENSE.

Copyright ยฉ 2017 The OpenSTF Project. All Rights Reserved.

stf's People

Contributors

0rzech avatar aberoham avatar afathonih avatar alexisoyama avatar aluedeke avatar att55 avatar bananayong avatar chibamap avatar codeskyblue avatar denis99999 avatar dependabot[bot] avatar gebitang avatar greenkeeperio-bot avatar gunta avatar jachstet-sea avatar koral-- avatar kwv avatar lenciel avatar lukzeg avatar luze-mobica avatar mitchtech avatar obrie avatar pcrepieux avatar skyline-gleb avatar sorccu avatar syncxplus avatar thasegaw avatar thinkhy avatar vbanthia avatar xu-duqing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stf's Issues

`adb connect` sometimes disconnects in newer versions of Android Studio

In newer version of Android studio, an adb connected STF device is sometimes lost in the middle of everything.

From initial packet capture logs it looks like it the connection is terminated on ADB side, after an A_OPEN somehow fails (and STF then responds with A_CLSE directly). Further investigation required.

Access Android Connected via Wifi

First STF working Great if we connect device via USB.

I was trying to connect device to adb with wifi

 adb tcpip 5555
adb connect mobile-ip:5555

But now adb show wifi connected device on adb devices command but stf display that device as disconnected.

Can't use STF with Docker

Hello,
I'm trying to run STF with Docker, but I got an error

stf@10d2f43a5185:/app$ stf local
INF/util:procutil 13 [] Forking "/app/lib/cli.js migrate"
INF/db 14 [
] Connecting to 127.0.0.1:28015
INF/db 14 [] Unable to connect to 127.0.0.1:28015
FTL/db 14 [
] No hosts left to try
FTL/util:lifecycle 14 [*] Shutting down due to fatal error

/app/node_modules/bluebird/js/main/promise.js:673
throw e;
^
ExitError: Exit code "1"
at ChildProcess. (/app/lib/util/procutil.js:49:23)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

Do you have an idea about the issue?

UI: Resize to fit the device

  • Resize when rotating
  • Resize when loading

Already doing it for the Standalone mode.
But in normal mode it might be annoying so test it first.

Screenshots not showing.

I can take screenshots and see them.
They are being saved in /var/folders/...
But when I change tabs from screenshot to any other tab and come back to screenshot they are gone from screenshots tab(but they are still saved on disk at /var/folders/...).

How to do LDAP authentication in STF

Hi,

I know STF provides authentication units for OAuth 2.0, LDAP, mock. When we run stf with this command "stf local", it will use mock implementation which only asks for a name and an email address.

But I want to use true user authentication by LDAP, suppose that we have a LDAP server like xxxx.xxxx.xxx:222, but how I run STF and use which command? Please help give some guidance, thanks a lot.

Can not use node -- debug cli local

Hi, thank you for your great app. I want to use node --debug to have a better understand of how it works. I tried node -- debug cli local, but it failed, both in node version 0.10 and 0.12. I googled and learned that this is a clustered app and all the workers attempted to listen on the same debug port. So how do you debug in your development? Can I set breakpoint on it? Can I debug it or part of it separately?

Starting rethinkdb in different port than 8080 (default)

I am trying to start rethinkdb in different port than the default one (command used - rethinkdb -o 8081) and then start "stf" (command used - stf local). But I am getting an error as -

INF/util:procutil 6386 [] Forking "/home/xxx/xxx/stf/lib/cli.js migrate"
INF/db 6394 [
] Connecting to 127.0.0.1:28015
INF/db 6394 [] Unable to connect to 127.0.0.1:28015
FTL/db 6394 [
] No hosts left to try
FTL/util:lifecycle 6394 [*] Shutting down due to fatal error

/home/zaloraqa/Downloads/stf/node_modules/bluebird/js/main/promise.js:673
throw e;
^
ExitError: Exit code "1"
at ChildProcess. (/home/xxxx/xxxx/stf/lib/util/procutil.js:49:23)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

So please let me know is it possible to run stf when renthinkdb not running in default port (8080)

Thanks

Screencapture performance

It's crazy good. seriously. Kicks the pants off Chrome devtools screencasting. :)

That said there appears to be something blocking a solid 60fps.

Here's what i'm seeing after profiling the full STF app using about:tracing

one frame of work

image

the real thing here is that we're in the resourcefetcher for the blob for a long ass time. that's really what's slowing down this process.

Here's the start: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp&q=%22%20TRACE_EVENT_ASYNC_BEGIN2(%22blink.net%22,%20%22Resource%22%22&sq=package:chromium&type=cs&l=901
Here's the end: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp&q=%22TRACE_EVENT_ASYNC_END0(%22blink.net%22,%20%22Resource%22%22&sq=package:chromium&type=cs&l=797

what's interesting to me is that if i poke inside of the browser process... it reports finishing loading the blob at about halfway:
image
(the actual "requestcomplete" on the browserthread is offscreen in the screenshot)

it's possible whatever is handling the blob URL is unimplemented, but right now it appears to be taking longer than I'd expect. might be a chrome bug.

sometimes I see a missed frame

image

In these cases we do two image decodes and throw one of them away immediately.
Not sure yet why this is happening.


Last thing, I'd consider trying out requestAnimationFrame, only because it provides the scheduler with a lot more information on when you're ready to paint a frame. It has a low-latency mode so you can call rAF immediately once the image has loaded and you should get an instant paint.


Here's the trace file i'm looking at: https://dl.dropboxusercontent.com/u/39519/temp/trace_stf-screencapture.json.gz

Add Standalone mode better discoverability

Currently pressing Shift+Click opens Standalone mode, however it needs better discoverability.

Possible options:

  • Add an icon for it (maybe, takes precious visual space)
  • Add a tooltip explaining it (maybe, and show only once)
  • Add it in a right context menu (definitely)

No direct preview on the dashboard.

I'm trying to use STF with a tablet Asus Nexus 7 with Android 4.2.2.
The device is controllable but the preview is grey and always grey.
See this attachment:
capture d ecran 2015-07-27 a 17 49 50

how to deploy without systemd

hi, my computer doesn't has systemd and it uses init , can stf deploy on my computer?
and my computer only has one port for public net and the port is 80, how can i deploy stf on my computer and visit it from the public net?
thank you for this wonderful project , it helps me a lot

Git clone?

bug

I'm a rookie and I don't know what's wrong. Wish you could tell me how to fix it.
Thank you.

Screen recording support

Android 4.4+ have a built-in support for screen recording:

shell@mako:/ $ screenrecord --help                                             
Usage: screenrecord [options] <filename>

Android screenrecord v1.2.  Records the device's display to a .mp4 file.

Options:
--size WIDTHxHEIGHT
    Set the video size, e.g. "1280x720".  Default is the device's main
    display resolution (if supported), 1280x720 if not.  For best results,
    use a size supported by the AVC encoder.
--bit-rate RATE
    Set the video bit rate, in bits per second.  Value may be specified as
    bits or megabits, e.g. '4000000' is equivalent to '4M'.  Default 4Mbps.
--bugreport
    Add additional information, such as a timestamp overlay, that is helpful
    in videos captured to illustrate bugs.
--time-limit TIME
    Set the maximum recording time, in seconds.  Default / maximum is 180.
--verbose
    Display interesting information on stdout.
--help
    Show this message.

Recording continues until Ctrl-C is hit or the time limit is reached.

Provide "Hardware" Advice for Mounting Solutions

The documentation in your README for relevant hardware is excellent! You might consider adding another section, with advice on the physical setup of the device farm.

For example: what exactly is shown in the photo at the top of the README, with the aluminum(?) slats holding the devices? My initial reaction was a rackmount system, but I would think that we would see holes in the vertical supports, and such holes do not appear in the photo.

Using STF for Test Automation

Hello guys,

Thanks for this awesome tool. I had fun in setting up this locally and its quite useful for debugging my apps.

The kind of feature I wish from STF is running UI Test Suites (Appium, Robotium, monkey runner etc) parallel on multiple devices similar to services such as testdroid, AWS Device Farm etc.

For this, they provide a feature for creating custom device pool where user can create a device group of their target devices. Then you upload your apk file and test suites then they will run your test and provide test results. They also provide apis for these features which makes CI integration easier.

I think it will be really helpful to have this kind of facility On-premises. It will give better control.

I want to know if this feature or something similar to this, is in your roadmap? If it is, please share how you want to implement this. I will be glad to contribute :)

Thanks,

Disconnection from some minicap failures

I had two devices up and running. Tried to do adb connect on one of them. It seemed to work but then I had a failure.
Looks like it came from minicap but STF disconnected as a result.

Feel free to close, but figured you'd appreciate the report.

Cheers guys. (This project is blowing my mind)

INF/device:plugins:connect 80128 [T076001226] New remote ADB connection from ::ffff:127.0.0.1
INF/provider 80100 [*] Found device "localhost:7403" (offline)
INF/reaper 80099 [reaper001] Device "localhost:7403" is present
INF/provider 80100 [*] Registered device "localhost:7403"
INF/provider 80100 [*] Providing all 2 of 3 device(s); ignoring "localhost:7403"
INF/provider 80100 [*] Device "localhost:7403" is now "device" (was "offline")
INF/device:support:push 80167 [localhost:7403] Sending output to "tcp://127.0.0.1:7116"
INF/device 80167 [localhost:7403] Preparing device
INF/device:support:sub 80167 [localhost:7403] Receiving input from "tcp://127.0.0.1:7114"
INF/device:support:sub 80167 [localhost:7403] Subscribing to permanent channel "*ALL"
INF/device:support:properties 80167 [localhost:7403] Loading properties
INF/device:support:abi 80167 [localhost:7403] Supports ABIs armeabi-v7a, armeabi
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/minicap.cpp:176) Received SIGTERM, stopping"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/minicap.cpp:478) Closing client connection"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:280) Destroying virtual display"
WRN/device:plugins:screen:stream 80128 [T076001226] Shell keeping minicap running ended unexpectedly
INF/device:plugins:screen:stream 80128 [T076001226] Disconnecting from minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Stopping minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Launching screen service
INF/device:plugins:screen:stream 80128 [T076001226] Connecting to minicap service
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "PID: 19794"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: Using projection 720x1280@377x670/0"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:236) Creating SurfaceComposerClient"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:239) Performing SurfaceComposerClient init check"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:246) Creating virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:252) Creating buffer queue"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:257) Creating CPU consumer"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:261) Creating frame waiter"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:265) Publishing virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 2766852 bytes for JPG encoder"
INF/device:plugins:screen:stream 80128 [T076001226] Reading minicap banner
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/minicap.cpp:423) New client connection"
WRN/device:plugins:screen:stream 80128 [T076001226] Shell keeping minicap running ended unexpectedly
INF/device:plugins:screen:stream 80128 [T076001226] Disconnecting from minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Stopping minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Launching screen service
INF/device:plugins:screen:stream 80128 [T076001226] Connecting to minicap service
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "PID: 19843"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: Using projection 720x1280@377x670/0"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:236) Creating SurfaceComposerClient"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:239) Performing SurfaceComposerClient init check"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:246) Creating virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:252) Creating buffer queue"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:257) Creating CPU consumer"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:261) Creating frame waiter"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:265) Publishing virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 2766852 bytes for JPG encoder"
INF/device:plugins:screen:stream 80128 [T076001226] Reading minicap banner
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/minicap.cpp:423) New client connection"
WRN/device:plugins:screen:stream 80128 [T076001226] Shell keeping minicap running ended unexpectedly
INF/device:plugins:screen:stream 80128 [T076001226] Disconnecting from minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Stopping minicap service
INF/device:plugins:screen:stream 80128 [T076001226] Launching screen service
INF/device:plugins:screen:stream 80128 [T076001226] Connecting to minicap service
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "PID: 19892"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: Using projection 720x1280@377x670/0"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:236) Creating SurfaceComposerClient"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:239) Performing SurfaceComposerClient init check"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:246) Creating virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:252) Creating buffer queue"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:257) Creating CPU consumer"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:261) Creating frame waiter"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (external/MY_minicap/src/minicap_22.cpp:265) Publishing virtual display"
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 2766852 bytes for JPG encoder"
INF/device:plugins:screen:stream 80128 [T076001226] Reading minicap banner
INF/device:plugins:screen:stream 80128 [T076001226] minicap says: "INFO: (jni/minicap/minicap.cpp:423) New client connection"
WRN/device:plugins:screen:stream 80128 [T076001226] Shell keeping minicap running ended unexpectedly
INF/device:plugins:screen:stream 80128 [T076001226] Disconnecting from minicap service
FTL/device:plugins:screen:stream 80128 [T076001226] Frame producer had an error Error: Failed more than 3 times in 10000ms
    at FrameProducer._failLimitExceeded (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/units/device/plugins/screen/stream.js:219:26)
    at FailCounter.emit (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/eventemitter3/index.js:73:35)
    at FailCounter.inc (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/failcounter.js:29:10)
    at FrameProducer._outputEnded (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/units/device/plugins/screen/stream.js:212:24)
    at RiskyStream.emit (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/eventemitter3/index.js:71:35)
    at RiskyStream.<anonymous> (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/riskystream.js:13:12)
    at Socket.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
FTL/util:lifecycle 80128 [T076001226] Shutting down due to fatal error

INF/provider 80100 [*] Lost device "localhost:7403" (device)
INF/provider 80100 [*] Shutting down device worker "localhost:7403"
INF/provider 80100 [*] Gracefully killing device worker "localhost:7403"
INF/provider 80100 [*] Cleaning up device worker "T076001226"
ERR/provider 80100 [*] Device worker "T076001226" died with code 1
INF/provider 80100 [*] Restarting device worker "T076001226"
FTL/device 80167 [localhost:7403] Setup had an error FailError: Failure: 'device not found'
    at /Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/parser.js:226:31
From previous event:
    at Parser.readError (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/parser.js:225:31)
    at /Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/command/host/transport.js:25:35
From previous event:
    at HostTransportCommand.execute (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/command/host/transport.js:19:39)
    at /Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/client.js:257:47
From previous event:
    at Client.transport (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/client.js:256:32)
    at Client.shell (/Users/paulirish/.homebrew/lib/node_modules/stf/node_modules/adbkit/lib/adb/client.js:262:19)
    at devutil.listPidsByComm (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:69:14)
    at devutil.killProcsByComm (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:106:18)
    at /Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:122:26
From previous event:
    at /Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:121:15
From previous event:
    at devutil.killProcsByComm (/Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:107:6)
    at /Users/paulirish/.homebrew/lib/node_modules/stf/lib/util/devutil.js:122:26
    at processImmediate [as _immediateCallback] (timers.js:358:17)
FTL/util:lifecycle 80167 [localhost:7403] Shutting down due to fatal error
INF/provider 80100 [*] Device worker "localhost:7403" has retired

Raspberry Pi support

Would that be possible? Currently running raspbian, but I get hit with a lot of installation and configuration.

Do you have any guides or tips?

Redirect sound to browser (from browser) (enhancement)

Really great software! Thanks very much! ๐Ÿ‘

There is a bit crazy idea - if it is ever possible - to redirect sound input/output to browser?
Might be useful for testing.

What do you think?

Also then one can finally leave phone at home and make calls from browser :-)

UI: Add Quality control

Reasons:

  • Old devices CPU are too slow (Slow JPEG encoding)
  • STF->Client Network speed may be too slow (Poor Wifi)
  • Client browser may be too slow (Mobile browser / Old PC)

Ways to do it:

  • Manual quality control: Low/Med/High
  • Auto quality control: Measure each blob loading time
    Have 3 L/M/H breakpoints for when the value goes below

What to adjust:

  • Image size
  • JPEG image quality

Screen sharing on some devices only shows grey

I have a Galaxy Nexus connected to an Ubuntu machine which doesn't seem to show the screen sharing at all (all I see is grey). Everything else about the device connect to OpenSTF, i.e. I can interact with the device with my mouse on the grey screen and I see it on my phone, adb connect, etc.

I realize this isn't much details to work on, but please let know what other details I can provide to help debug this.

The Camera button doesn't have any effect.

Hello,
I would like to repport a bug i'm facing with the Sony Xperia S on Android 4.0.4:
I control the Smartphone without any problem. This real device has a material camera button. A long press on it launch the camera application.

On the Advanced Tab of STF, a clic on the Camera button has no effect. A Long clic neither.

In addition, if on the device I launch the camera, the screen is black (but all controls are okay). See this attachment:
capture d ecran 2015-07-27 a 16 17 16

Make it easier to drag from device edges

As reported in https://groups.google.com/forum/#!topic/openstf/KE7I9b8EkgU, dragging from the screen edge to trigger, for example, a side menu, won't sometimes work because you end up resizing the browser instead. Adding some margin would solve the issue, but reduce the available space for the screen itself.

One possible option would perhaps be to wait for a few seconds when the pointer is in close proximity of the screen edges, and then "zoom out" a little bit so that it becomes possible to drag from the edge.

Can't take screenshot. The image "<url to screenshot file>" cannot be displayed because it contains errors.

Hello!
Thank you for awesome software!

Unfortunately I faced some problem with taking screenshots, I hope you can help me.
When I try to take a screenshot, I see an icon which shows screenshot image is not available:
torn_minicap
When I try to click this image, I see following error message in a new browser tab:
The image "http://<my-ip>:7100/s/image/5aac3806-8ba7-4f29-bc49-1bcc1f28dede/<deviceName>.jpg" cannot be displayed because it contains errors.

I tried to download image by url, and noticed image is just empty file(0 bytes size).

Stf is launched in "local" mode on my ubuntu 14.04 desktop like this:
stf local --public-ip <my-ip>
[there is no X server running on desktop, if it is important]
I am trying to take screenshot from my laptop

So, in console log I noticed following messages:
INF/device:plugins:screen:capture 25422 [<deviceName>] Capturing screenshot INF/storage:temp 25341 [*] Uploaded "<deviceName>.jpg" to "/tmp/upload_04db85c0a0bff470298192dcaffd7049" INF/device:support:storage 25422 [<deviceName>] Uploaded to "/s/image/5aac3806-8ba7-4f29-bc49-1bcc1f28dede/<deviceName>.jpg"

I checked the file /tmp/upload_04db85c0a0bff470298192dcaffd7049 and found my screenshot.

redirect loop from phone

So, when navigating to STF, you get redirected to your localhost.

However, if you would want to connect from you iPhone that won't work, because it will just keep looking for the localhost of the phone, not from the other computer running STF. Also, when using a proxy, this won't work.

By just removing the redirect, this issue would be fixed (I guess?).

some one stole your device

Hi, i am using stf with an android tv magic box , it's os is based on android and it is connected to adb using network , i use --allow-remote to start stf , when i try to control the device , it waits for a while and tells me some one stole your device , i don't know what dose that mean , what errors can cause that ?

Screen stops on the first capture (Neken NX, Yoga Tablet 8)

i have a NX device and sdk is 17, but i find that the screen only shows the first capture and do not move again. on my device my act takes effect and the screen changed , but in the brower the screen do not move. do you have any suggestions for that?

Can't start freshly built STF because of webpack

Hi,

here is the log:
stf local
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js migrate"
INF/db 24095 [
] Connecting to 127.0.0.1:28015
INF/db:setup 24095 [] Database "stf" already exists
INF/db:setup 24095 [
] Table "users" already exists
INF/db:setup 24095 [] Table "devices" already exists
INF/db:setup 24095 [
] Table "logs" already exists
INF/db:setup 24095 [] Index "users"."adbKeys" already exists
INF/db:setup 24095 [
] Index "devices"."owner" already exists
INF/db:setup 24095 [] Index "devices"."present" already exists
INF/db:setup 24095 [
] Index "devices"."providerChannel" already exists
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js triproxy app001 --bind-pub tcp://127.0.0.1:7111 --bind-dealer tcp://127.0.0.1:7112 --bind-pull tcp://127.0.0.1:7113"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js triproxy dev001 --bind-pub tcp://127.0.0.1:7114 --bind-dealer tcp://127.0.0.1:7115 --bind-pull tcp://127.0.0.1:7116"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js processor proc001 --connect-app-dealer tcp://127.0.0.1:7112 --connect-dev-dealer tcp://127.0.0.1:7115"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js processor proc002 --connect-app-dealer tcp://127.0.0.1:7112 --connect-dev-dealer tcp://127.0.0.1:7115"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js reaper reaper001 --connect-push tcp://127.0.0.1:7116 --connect-sub tcp://127.0.0.1:7111"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js provider --name ubuntu --min-port 7400 --max-port 7700 --connect-sub tcp://127.0.0.1:7114 --connect-push tcp://127.0.0.1:7116 --group-timeout 900 --public-ip localhost --storage-url http://localhost:7100/ --adb-host 127.0.0.1 --adb-port 5037"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js auth-mock --port 7120 --secret kute kittykat --app-url http://localhost:7100/"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js app --port 7105 --secret kute kittykat --auth-url http://localhost:7100/auth/mock/ --websocket-url http://localhost:7110/"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js websocket --port 7110 --secret kute kittykat --storage-url http://localhost:7100/ --connect-sub tcp://127.0.0.1:7111 --connect-push tcp://127.0.0.1:7113"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js storage-temp --port 7102"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js storage-plugin-image --port 7103 --storage-url http://localhost:7100/"
INF/util:procutil 24092 [
] Forking "/usr/lib/node_modules/stf/lib/cli.js storage-plugin-apk --port 7104 --storage-url http://localhost:7100/"
INF/util:procutil 24092 [] Forking "/usr/lib/node_modules/stf/lib/cli.js poorxy --port 7100 --app-url http://localhost:7105/ --auth-url http://localhost:7120/ --websocket-url http://localhost:7110/ --storage-url http://localhost:7102/ --storage-plugin-image-url http://localhost:7103/ --storage-plugin-apk-url http://localhost:7104/"
INF/triproxy 24098 [app001] PUB socket bound on tcp://127.0.0.1:7111
INF/triproxy 24098 [app001] DEALER socket bound on tcp://127.0.0.1:7112
INF/triproxy 24098 [app001] PULL socket bound on tcp://127.0.0.1:7113
INF/triproxy 24099 [dev001] PUB socket bound on tcp://127.0.0.1:7114
INF/triproxy 24099 [dev001] DEALER socket bound on tcp://127.0.0.1:7115
INF/triproxy 24099 [dev001] PULL socket bound on tcp://127.0.0.1:7116
INF/reaper 24104 [reaper001] Subscribing to permanent channel "ALL"
INF/reaper 24104 [reaper001] Reaping devices with no heartbeat
INF/db 24104 [reaper001] Connecting to 127.0.0.1:28015
INF/db 24103 [proc002] Connecting to 127.0.0.1:28015
INF/reaper 24104 [reaper001] Receiving input from "tcp://127.0.0.1:7111"
INF/reaper 24104 [reaper001] Sending output to "tcp://127.0.0.1:7116"
INF/processor 24103 [proc002] App dealer connected to "tcp://127.0.0.1:7112"
INF/processor 24103 [proc002] Device dealer connected to "tcp://127.0.0.1:7115"
INF/db 24100 [proc001] Connecting to 127.0.0.1:28015
INF/processor 24100 [proc001] App dealer connected to "tcp://127.0.0.1:7112"
INF/processor 24100 [proc001] Device dealer connected to "tcp://127.0.0.1:7115"
INF/poorxy 24122 [
] Listening on port 7100
INF/storage:plugins:image 24120 [
] Listening on port 7103
INF/auth-mock 24106 [] Listening on port 7120
INF/storage:temp 24115 [
] Listening on port 7102
INF/storage:plugins:apk 24121 [] Listening on port 7104
INF/provider 24105 [
] Subscribing to permanent channel "O6uuMWGCQiygamxH7OprEA=="
INF/provider 24105 [] Sending output to "tcp://127.0.0.1:7116"
INF/provider 24105 [
] Receiving input from "tcp://127.0.0.1:7114"
INF/provider 24105 [] Tracking devices
INF/provider 24105 [
] Found device "0146B5681401101C" (offline)
INF/reaper 24104 [reaper001] Device "0146B5681401101C" is present
INF/provider 24105 [] Registered device "0146B5681401101C"
INF/app 24107 [
] Using webpack
module.js:338
throw err;
^
Error: Cannot find module './../../../webpack.config'
at Function.Module.resolveFilename (module.js:336:15)
at Function.Module.load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at module.exports (/usr/lib/node_modules/stf/lib/units/app/index.js:56:31)
at Command. (/usr/lib/node_modules/stf/lib/cli.js:627:27)
at Command.listener (/usr/lib/node_modules/stf/node_modules/commander/index.js:301:8)
at Command.emit (events.js:110:17)
at Command.parseArgs (/usr/lib/node_modules/stf/node_modules/commander/index.js:610:12)
at Command.parse (/usr/lib/node_modules/stf/node_modules/commander/index.js:458:21)
at Object. (/usr/lib/node_modules/stf/lib/cli.js:1102:9)
at Module.compile (module.js:460:26)
at Object.Module.extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module.load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
FTL/cli:local 24092 [
] Child process had an error ExitError: Exit code "1"
at ChildProcess. (/usr/lib/node_modules/stf/lib/util/procutil.js:49:23)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess.handle.onexit (child_process.js:1074:12)
INF/cli:local 24092 [
] Shutting down all child processes
INF/util:lifecycle 24098 [app001] Winding down for graceful exit
INF/util:lifecycle 24103 [proc002] Winding down for graceful exit
INF/util:lifecycle 24100 [proc001] Winding down for graceful exit
INF/util:lifecycle 24105 [
] Winding down for graceful exit
INF/util:lifecycle 24104 [reaper001] Winding down for graceful exit
INF/util:lifecycle 24106 [
] Winding down for graceful exit
INF/auth-mock 24106 [] Waiting for client connections to end
WRN/db 24104 [reaper001] Connection closed
INF/db 24104 [reaper001] Connecting to 127.0.0.1:28015
WRN/db 24100 [proc001] Connection closed
INF/db 24100 [proc001] Connecting to 127.0.0.1:28015
INF/websocket 24110 [] Subscribing to permanent channel "ALL"
INF/websocket 24110 [
] Listening on port 7110
INF/util:lifecycle 24110 [] Winding down for graceful exit
INF/db 24110 [
] Connecting to 127.0.0.1:28015

But... webpack seems to be installed:
npm install webpack -g
npm WARN optional dep failed, continuing [email protected]
/usr/bin/webpack -> /usr/lib/node_modules/webpack/bin/webpack.js
[email protected] /usr/lib/node_modules/webpack
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

Can you help?
Thanks.

invalid csrf token

ForbiddenError: invalid csrf token
at verifytoken (/app/node_modules/csurf/index.js:269:11)
at csrf (/app/node_modules/csurf/index.js:97:7)
at Layer.handle as handle_request
at trim_prefix (/app/node_modules/express/lib/router/index.js:312:13)
at /app/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12)
at next (/app/node_modules/express/lib/router/index.js:271:10)
at jsonParser (/app/node_modules/body-parser/lib/types/json.js:107:37)
at Layer.handle as handle_request
at trim_prefix (/app/node_modules/express/lib/router/index.js:312:13)
at /app/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12)
at next (/app/node_modules/express/lib/router/index.js:271:10)
at /app/lib/units/app/middleware/auth.js:36:13
at tryCatcher (/app/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/main/promise.js:489:31)

met this problems when i test it in my environment. adb works and the whole log was attached.

root@ubuntu:/app# adb devices
List of devices attached
00445e524f8c5907 device

INF/device:support:sub 545 [00445e524f8c5907] Subscribing to permanent channel "ALL"
INF/device:support:properties 545 [00445e524f8c5907] Loading properties
INF/device:support:abi 545 [00445e524f8c5907] Supports ABIs armeabi-v7a, armeabi
INF/device:resources:service 545 [00445e524f8c5907] Checking whether we need to install STFService
INF/device:resources:service 545 [00445e524f8c5907] Running version check
INF/device:resources:service 545 [00445e524f8c5907] STFService up to date
INF/device:plugins:service 545 [00445e524f8c5907] Launching agent
INF/device:plugins:service 545 [00445e524f8c5907] Launching service
INF/device:plugins:service 545 [00445e524f8c5907] Agent says: "Listening on port 1090"
INF/device:plugins:service 545 [00445e524f8c5907] Agent says: "InputClient started"
INF/device:plugins:display 545 [00445e524f8c5907] Reading display info
INF/device:plugins:phone 545 [00445e524f8c5907] Fetching phone info
INF/device:plugins:identity 545 [00445e524f8c5907] Solving identity
INF/device:plugins:solo 545 [00445e524f8c5907] Subscribing to permanent channel "S+KScTlq18iysOfuoUm6iN5WyIc="
INF/device:plugins:screen:stream 545 [00445e524f8c5907] Starting WebSocket server on port 7400
INF/device:plugins:browser 545 [00445e524f8c5907] Loading browser list
INF/device:plugins:browser 545 [00445e524f8c5907] Updating browser list
WRN/device:plugins:data 545 [00445e524f8c5907] Unable to find device data { serial: '00445e524f8c5907',
platform: 'Android',
manufacturer: 'LGE',
operator: null,
model: 'Nexus 4',
version: '5.0',
abi: 'armeabi-v7a',
sdk: '21',
product: 'occam',
display:
{ id: 0,
width: 768,
height: 1280,
xdpi: 319.7900085449219,
ydpi: 318.7449951171875,
fps: 60,
density: 2,
rotation: 0,
secure: true,
size: 4.679082154320592,
url: 'ws://localhost:7400' },
phone: { imei: '353918051433593', network: 'UNKNOWN' } }
INF/device:plugins:touch 545 [00445e524f8c5907] Touch origin is top left
INF/device:plugins:touch 545 [00445e524f8c5907] Requesting touch consumer to start
INF/device:plugins:touch 545 [00445e524f8c5907] Launching screen service
INF/device:plugins:touch 545 [00445e524f8c5907] Connecting to minitouch service
INF/device:plugins:touch 545 [00445e524f8c5907] minitouch says: "Type B touch device touch_dev (1535x2559 with 10 contacts) detected on /dev/input/event2 (score 1100)"
INF/device:plugins:touch 545 [00445e524f8c5907] Reading minitouch banner
INF/device:plugins:touch 545 [00445e524f8c5907] minitouch says: "Connection established"
INF/device:plugins:forward 545 [00445e524f8c5907] Launching reverse port forwarding service
INF/device:plugins:forward 545 [00445e524f8c5907] Connecting to reverse port forwarding service
INF/device:plugins:connect 545 [00445e524f8c5907] Listening on port 7401
INF/device 545 [00445e524f8c5907] Fully operational
INF/provider 487 [
] Providing all 1 device(s)

how can i disable auth module?

i don't want the auth module , and i tried to disable it , but i don't have req.user in js
is it possible to disable auth module?

Add view only mode

What about a view only mode? So if you have automated testing you can view what is going on w/o control the device.

how to expand device pool to 100+?

Hi

Firstly, thanks for you great project.
I have a question about how to expand device pool to 100+? Suppose one PC has 4 motherboard's USB ports, and each one connects to a usb hub with 7 ports. It can only connect to 28 devices, how we can expand to 100+?

Post unknown devices to a public DB

For stf-device-db.

Ways to POST data to Google Spreadsheets:

Possible ways to send the data:

  • Just from the error logs, the admin will see it and copy/paste the device info to the Google Form (Low discoverability).
  • From the UI, show a dialog (only once) asking if its OK to "send the data of the following unknown devices" (High discoverability). May be a bit annoying because it will be shown to all users using STF (even if its only once). Need to maintain a list of unknown devices in the db.

How to be scope in the IP address?

Thank you for a great app! Immediately, we are using.

When you start with "$stf local" command, you can use in the http://localhost:7100, for example, start at IP address, such as 192.168.1.100, and we would like to access from other PC.

The start-up command was some experience, but the connection to the DB is becomes to "127.0.0.1:28015", it can not be started.
*"rethinkdb" is, "- bind all" you have to start it with the option.

In order to use to share the STF is allowed to access from other PC, but I want to start with IP address, Could you tell me how?

How to launch the task manager and kill a running android application with STF ?

Hello guys,

I'm investigating STF and I'm facing a limitation:
On the real device, i've a "system" button that display all the currently running application. On this "task manager" view, I can kill some process. On the control screen of STF, there are 3 buttons: "Menu", "Home" and "Back". On my real device, there are 3 buttons: "System", "Home" and "Back".

How to simulate a click on this "System" button ?
How to replace the "Menu" button by a "System" button ?
Does exist a way to display the "task manager" view with STF ?
What is the Shell command to kill an Android process ?

Thanks for your answers.

minicap unable to lock next buffer

i run on my android tv box and gets this error
minicap error: "ERROR: (external/MY_minicap/src/minicap_17.cpp:123: errno: Invalid argument) Unable to lock next buffer BAD_VALUE (-22)"
is it something wrong with my android device or can i do something to fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.