Commit c3ecd6c1 authored by Simo Kinnunen's avatar Simo Kinnunen

Match adbkit documentation.

parent 5a59ef2f
# Contributing
We are happy to accept any contributions that make sense and respect the rules listed below.
## How to contribute
1. Fork the repo.
2. Create a feature branch for your contribution out of the `develop` branch. We use the [git-flow][gitflow-tool] tool to implement the [successful Git branching model][gitflow-post]. Only one contribution per branch is accepted.
3. Implement your contribution while respecting our rules (see below).
4. Run `npm test` to make sure you didn't break anything.
5. Add tests for your contribution so that no one else will break it.
6. Submit a pull request against our `develop` branch!
## Rules
* **Do** use feature branches.
* **Do** conform to existing coding style so that your contribution fits in.
* **Do** use [EditorConfig] to enforce our [whitespace rules](.editorconfig). If your editor is not supported, enforce the settings manually.
* **Do** run `npm test` for CoffeeLint, JSONLint and unit test coverage.
* **Do not** touch the `version` field in [package.json](package.json).
* **Do not** commit any generated files, unless already in the repo. If absolutely necessary, explain why.
* **Do not** create any top level files or directories. If absolutely necessary, explain why and update [.npmignore](.npmignore).
## License
By contributing your code, you agree to license your contribution under our [LICENSE](LICENSE).
[gitflow-post]: <http://nvie.com/posts/a-successful-git-branching-model/>
[gitflow-tool]: <https://github.com/nvie/gitflow>
[editorconfig]: <http://editorconfig.org/>
......@@ -2,9 +2,7 @@
**adbkit-monkey** provides a [Node.js][nodejs] interface for working with the Android [`monkey` tool][monkey-site]. Albeit undocumented, they monkey program can be started in TCP mode with the `--port` argument. In this mode, it accepts a [range of commands][monkey-proto] that can be used to interact with the UI in a non-random manner. This mode is also used internally by the [`monkeyrunner` tool][monkeyrunner-site], although the documentation claims no relation to the monkey tool.
Note that while adbkit-monkey is written in CoffeeScript, it is compiled to JavaScript before publishing to NPM, which means that you are not required to use CoffeeScript.
## Installation
## Getting started
Install via NPM:
......@@ -12,11 +10,13 @@ Install via NPM:
npm install --save adbkit-monkey
```
## Examples
Note that while adbkit-monkey is written in CoffeeScript, it is compiled to JavaScript before publishing to NPM, which means that you are not required to use CoffeeScript.
### Examples
The following examples assume that monkey is already running (via `adb shell monkey --port 1080`) and a port forwarding (`adb forward tcp:1080 tcp:1080`) has been set up.
### Press the home button
#### Press the home button
```javascript
var assert = require('assert');
......@@ -31,7 +31,7 @@ client.press(3 /* KEYCODE_HOME */, function(err) {
});
```
### Drag out the notification bar
#### Drag out the notification bar
```javascript
var assert = require('assert');
......@@ -61,7 +61,7 @@ client.multi()
});
```
### Get display size
#### Get display size
```javascript
var assert = require('assert');
......@@ -79,7 +79,7 @@ client.getDisplayWidth(function(err, width) {
});
```
### Type text
#### Type text
Note that you should manually focus a text field first.
......@@ -442,13 +442,17 @@ Sends all buffered commands.
* **err** `null` when successful, `Error` otherwise.
* **values** An array of all response values, identical to individual `Api` responses.
## Links
## More information
* [Monkey][monkey-site]
- [Source code][monkey-source]
- [Protocol][monkey-proto]
* [Monkeyrunner][monkeyrunner-site]
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
## License
See [LICENSE](LICENSE).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment