{"versions":{"1.2.0":{"name":"@devicefarmer/adbkit-monkey","version":"1.2.0","description":"A Node.js interface to the Android monkey tool.","keywords":["adb","adbkit","monkey","monkeyrunner"],"bugs":{"url":"https://github.com/CyberAgent/adbkit-monkey/issues"},"license":"Apache-2.0","author":{"name":"DeviceFarmer","email":"contact@devicefarmer.com","url":"https://devicefarmer.com/"},"main":"./lib/monkey.js","repository":{"type":"git","url":"git+https://github.com/DeviceFarmer/adbkit-monkey.git"},"scripts":{"postpublish":"grunt clean","prepublish":"grunt coffee","test":"grunt test"},"dependencies":{"async":"~0.2.9"},"devDependencies":{"chai":"~1.8.1","coffee-script":"~1.6.3","grunt":"~0.4.1","grunt-cli":"~0.1.11","grunt-coffeelint":"~0.0.7","grunt-contrib-clean":"~0.5.0","grunt-contrib-coffee":"~0.7.0","grunt-contrib-watch":"~0.5.3","grunt-exec":"~0.4.2","grunt-jsonlint":"~1.0.2","grunt-notify":"~0.2.16","mocha":"~1.14.0","sinon":"~1.17.7","sinon-chai":"~2.4.0"},"engines":{"node":">= 0.10.4"},"gitHead":"15f6b28e57125c69c2c5c529b587823a129a4b18","homepage":"https://github.com/DeviceFarmer/adbkit-monkey#readme","_id":"@devicefarmer/adbkit-monkey@1.2.0","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","dist":{"shasum":"d524ddbd65410ff71fc47d474d6a4b8c5d15bc9f","size":7996,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@devicefarmer/adbkit-monkey/-/adbkit-monkey-1.2.0.tgz","integrity":"sha512-IQ5D/rq0uuI4LHTRxhlF9lAxCR+Rg8VI7JthObe5N1gyeaxl6qRlWnRZYM7apOOASOadCnMcTY1hcDtG8VtaZw=="},"_npmUser":{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"},"directories":{},"maintainers":[{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adbkit-monkey_1.2.0_1632262392151_0.4513054309580111"},"_hasShrinkwrap":false,"publish_time":1632262392331,"_cnpm_publish_time":1632262392331,"_cnpmcore_publish_time":"2021-12-18T20:40:13.156Z","contributors":[]},"1.1.0":{"name":"@devicefarmer/adbkit-monkey","version":"1.1.0","description":"A Node.js interface to the Android monkey tool.","keywords":["adb","adbkit","monkey","monkeyrunner"],"bugs":{"url":"https://github.com/CyberAgent/adbkit-monkey/issues"},"license":"Apache-2.0","author":{"name":"DeviceFarmer","email":"contact@devicefarmer.com","url":"https://devicefarmer.com/"},"main":"./index","repository":{"type":"git","url":"git+https://github.com/devicefarmer/adbkit-monkey.git"},"scripts":{"postpublish":"grunt clean","prepublish":"grunt coffee","test":"grunt test"},"dependencies":{"async":"~0.2.9"},"devDependencies":{"chai":"~1.8.1","coffee-script":"~1.6.3","grunt":"~0.4.1","grunt-cli":"~0.1.11","grunt-coffeelint":"~0.0.7","grunt-contrib-clean":"~0.5.0","grunt-contrib-coffee":"~0.7.0","grunt-contrib-watch":"~0.5.3","grunt-exec":"~0.4.2","grunt-jsonlint":"~1.0.2","grunt-notify":"~0.2.16","mocha":"~1.14.0","sinon":"~1.17.7","sinon-chai":"~2.4.0"},"engines":{"node":">= 0.10.4"},"gitHead":"4b0404894a1e7039b733e4de50d6b1d9802e3bf4","homepage":"https://github.com/devicefarmer/adbkit-monkey#readme","_id":"@devicefarmer/adbkit-monkey@1.1.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"shasum":"87a53ac02278b9803cc753fea5ec87457c717f64","size":7916,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@devicefarmer/adbkit-monkey/-/adbkit-monkey-1.1.0.tgz","integrity":"sha512-De6bm/IQXTeYI0/fMO+lddEmNCenTOsHMqCga7oGWL1x71VsOlrytn0Kqso0Rzq96xzizMPZ8jgoGG5M6f2baQ=="},"_npmUser":{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"},"directories":{},"maintainers":[{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adbkit-monkey_1.1.0_1615199375067_0.4746046294711119"},"_hasShrinkwrap":false,"publish_time":1615199375186,"_cnpm_publish_time":1615199375186,"_cnpmcore_publish_time":"2021-12-18T20:40:13.460Z","contributors":[]},"1.0.1":{"name":"@devicefarmer/adbkit-monkey","version":"1.0.1","description":"A Node.js interface to the Android monkey tool.","keywords":["adb","adbkit","monkey","monkeyrunner"],"bugs":{"url":"https://github.com/CyberAgent/adbkit-monkey/issues"},"license":"Apache-2.0","author":{"name":"CyberAgent, Inc.","email":"npm@cyberagent.co.jp","url":"http://www.cyberagent.co.jp/"},"main":"./index","repository":{"type":"git","url":"git+https://github.com/CyberAgent/adbkit-monkey.git"},"scripts":{"postpublish":"grunt clean","prepublish":"grunt coffee","test":"grunt test"},"dependencies":{"async":"~0.2.9"},"devDependencies":{"chai":"~1.8.1","coffee-script":"~1.6.3","grunt":"~0.4.1","grunt-cli":"~0.1.11","grunt-coffeelint":"~0.0.7","grunt-contrib-clean":"~0.5.0","grunt-contrib-coffee":"~0.7.0","grunt-contrib-watch":"~0.5.3","grunt-exec":"~0.4.2","grunt-jsonlint":"~1.0.2","grunt-notify":"~0.2.16","mocha":"~1.14.0","sinon":"~1.7.3","sinon-chai":"~2.4.0"},"engines":{"node":">= 0.10.4"},"gitHead":"de0aa092d662758c1d9037cc9fda3e08123e3683","homepage":"https://github.com/CyberAgent/adbkit-monkey#readme","_id":"@devicefarmer/adbkit-monkey@1.0.1","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"7d225e5fdbdad8d6772453390ecab3f1b0eb72b1","size":7543,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@devicefarmer/adbkit-monkey/-/adbkit-monkey-1.0.1.tgz","integrity":"sha512-HilPrVrCosYWqSyjfpDtaaN1kJwdlBpS+IAflP3z+e7nsEgk3JGJf1Vg0NgHJooTf5HDfXSyZqMVg+5jvXCK0g=="},"maintainers":[{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"}],"_npmUser":{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adbkit-monkey_1.0.1_1589629484994_0.3325077593348327"},"_hasShrinkwrap":false,"publish_time":1589629485226,"_cnpm_publish_time":1589629485226,"_cnpmcore_publish_time":"2021-12-18T20:40:13.657Z","contributors":[]},"1.2.1":{"name":"@devicefarmer/adbkit-monkey","version":"1.2.1","description":"A Node.js interface to the Android monkey tool.","keywords":["adb","adbkit","monkey","monkeyrunner"],"bugs":{"url":"https://github.com/CyberAgent/adbkit-monkey/issues"},"license":"Apache-2.0","author":{"name":"DeviceFarmer","email":"contact@devicefarmer.com","url":"https://devicefarmer.com/"},"main":"./lib/monkey.js","repository":{"type":"git","url":"git+https://github.com/DeviceFarmer/adbkit-monkey.git"},"scripts":{"postpublish":"grunt clean","prepublish":"grunt coffee","test":"grunt test"},"devDependencies":{"chai":"~1.8.1","coffee-script":"~1.6.3","grunt":"~0.4.1","grunt-cli":"~0.1.11","grunt-coffeelint":"~0.0.7","grunt-contrib-clean":"~0.5.0","grunt-contrib-coffee":"~0.7.0","grunt-contrib-watch":"~0.5.3","grunt-exec":"~0.4.2","grunt-jsonlint":"~1.0.2","grunt-notify":"~0.2.16","mocha":"~1.14.0","sinon":"~1.17.7","sinon-chai":"~2.4.0"},"engines":{"node":">= 0.10.4"},"gitHead":"3c7fb7f6574ab65ae9cf0be2a2c812c1bb0932fa","homepage":"https://github.com/DeviceFarmer/adbkit-monkey#readme","_id":"@devicefarmer/adbkit-monkey@1.2.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-ZzZY/b66W2Jd6NHbAhLyDWOEIBWC11VizGFk7Wx7M61JZRz7HR9Cq5P+65RKWUU7u6wgsE8Lmh9nE4Mz+U2eTg==","shasum":"28cd6a121c5d572588081dd1c53454c604eef241","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@devicefarmer/adbkit-monkey/-/adbkit-monkey-1.2.1.tgz","fileCount":15,"unpackedSize":34063,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSR+JRwsHZK9LlI0X45mzhTVPwkRkvLpuj+wo6/zFORQIhAMWrzNWQaIwqLKFR3LQXDF0garY53OGuM+NZYKsZmPt8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJim5jrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7ehAAovGkvQqmnufZ0eiWYpix7Gfg55a6nXYhnTO9Qtu+MJDRGAvL\r\nfGsfzXh8HZ7sD2h4OlU4phaHW+XjV7m+rnTCrqrZOOztVXFbRSF7e+Uea7kz\r\nIqRyYqqMX5YoFadgN5DauBWQN4q99ZAH0jmC/X3cbEohhA0UQXhcctX18Cfv\r\npuoHj1In65pngG1O8Y05+nPadBtEfahIGLMARQG1Qxze4zRU/nQLcmYs5PKZ\r\nDIFKCbYfqss0ELbCG88pQuvWTyn4ZaHHa16Lf+J8tJkUm2l1p4zL5fuKlh2k\r\nSmg+vW24SlGfUbGM76V/8/MUWnrErTgkC4LZQ2qyex1Fe9cE1tlJqlMpQiEo\r\nf43cL6eQMsrMtMX1D3W1v2RXrewEnBPndWCUDlF4eJ8M3XSPUdXvdez8Crn7\r\naTbQgBbBPP3oy5C3+L+TCITJ39Sug4oQlbzaewijx0qmW5tzufBICtYAjUcF\r\nTN90kSepUaaKUBbygdB8o5O5tdAFY7aI3+THWkT1T48lfStFGIEunaSZ5zDM\r\nANuDSzI9Sgz3zC/Y0opR1MXN/FdRWFsCrKe3XKLMFi+iYYQJOGV7XcztpYqg\r\nxAbUfQ6o5wbWVdKlBupW9KOl87KE4v6co1INBbfXEdH/Fk6k42ai3P+qLZrm\r\nt5Bl5OpIhgs/CUoan6Tqt3okvYnOMudFA0E=\r\n=idNR\r\n-----END PGP SIGNATURE-----\r\n","size":7989},"_npmUser":{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"},"directories":{},"maintainers":[{"name":"anonymous","email":"karol.wrotniak@droidsonroids.pl"},{"name":"anonymous","email":"npm@codechild.com"},{"name":"anonymous","email":"denis.barbaron@orange.com"},{"name":"anonymous","email":"pierre.crepieux@orange.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/adbkit-monkey_1.2.1_1654364395263_0.8948950573735099"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-05T13:38:45.640Z","contributors":[]}},"dist-tags":{"latest":"1.2.1"},"name":"@devicefarmer/adbkit-monkey","time":{"created":"2022-01-26T23:24:59.476Z","modified":"2022-06-06T00:47:36.548Z","1.2.0":"2021-09-21T22:13:12.331Z","1.1.0":"2021-03-08T10:29:35.186Z","1.0.1":"2020-05-16T11:44:45.226Z","1.2.1":"2022-06-04T17:39:55.449Z"},"readme":"# adbkit-monkey\n\n**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.\n\n## Getting started\n\nInstall via NPM:\n\n```bash\nnpm install --save adbkit-monkey\n```\n\nNote 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.\n\n### Examples\n\nThe 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.\n\n#### Press the home button\n\n```javascript\nvar assert = require('assert');\nvar monkey = require('adbkit-monkey');\n\nvar client = monkey.connect({ port: 1080 });\n\nclient.press(3 /* KEYCODE_HOME */, function(err) {\n  assert.ifError(err);\n  console.log('Pressed home button');\n  client.end();\n});\n```\n\n#### Drag out the notification bar\n\n```javascript\nvar assert = require('assert');\nvar monkey = require('adbkit-monkey');\n\nvar client = monkey.connect({ port: 1080 });\n\nclient.multi()\n  .touchDown(100, 0)\n  .sleep(5)\n  .touchMove(100, 20)\n  .sleep(5)\n  .touchMove(100, 40)\n  .sleep(5)\n  .touchMove(100, 60)\n  .sleep(5)\n  .touchMove(100, 80)\n  .sleep(5)\n  .touchMove(100, 100)\n  .sleep(5)\n  .touchUp(100, 100)\n  .sleep(5)\n  .execute(function(err) {\n    assert.ifError(err);\n    console.log('Dragged out the notification bar');\n    client.end();\n  });\n```\n\n#### Get display size\n\n```javascript\nvar assert = require('assert');\nvar monkey = require('adbkit-monkey');\n\nvar client = monkey.connect({ port: 1080 });\n\nclient.getDisplayWidth(function(err, width) {\n  assert.ifError(err);\n  client.getDisplayHeight(function(err, height) {\n    assert.ifError(err);\n    console.log('Display size is %dx%d', width, height);\n    client.end();\n  });\n});\n```\n\n#### Type text\n\nNote that you should manually focus a text field first.\n\n```javascript\nvar assert = require('assert');\nvar monkey = require('adbkit-monkey');\n\nvar client = monkey.connect({ port: 1080 });\n\nclient.type('hello monkey!', function(err) {\n  assert.ifError(err);\n  console.log('Said hello to monkey');\n  client.end();\n});\n```\n\n## API\n\n### Monkey\n\n#### monkey.connect(options)\n\nUses [Net.connect()][node-net] to open a new TCP connection to monkey. Useful when combined with `adb forward`.\n\n* **options** Any options [`Net.connect()`][node-net] accepts.\n* Returns: A new monkey `Client` instance.\n\n#### monkey.connectStream(stream)\n\nAttaches a monkey client to an existing monkey protocol stream.\n\n* **stream** The monkey protocol [`Stream`][node-stream].\n* Returns: A new monkey `Client` instance.\n\n### Client\n\nImplements `Api`. See below for details.\n\n#### Events\n\nThe following events are available:\n\n* **error** **(err)** Emitted when an error occurs.\n    * **err** An `Error`.\n* **end** Emitted when the stream ends.\n* **finish** Emitted when the stream finishes.\n\n#### client.end()\n\nEnds the underlying stream/connection.\n\n* Returns: The `Client` instance.\n\n#### client.multi()\n\nReturns a new API wrapper that buffers commands for simultaneous delivery instead of sending them individually. When used with `api.sleep()`, allows simple gestures to be executed.\n\n* Returns: A new `Multi` instance. See `Multi` below.\n\n#### client.send(command, callback)\n\nSends a raw protocol command to monkey.\n\n* **command** The command to send. When `String`, a single command is sent. When `Array`, a series of commands is sent at once.\n* **callback(err, value, command)** Called when monkey responds to the command. If multiple commands were sent, the callback will be called once for each command.\n    * **err** `null` when successful, `Error` otherwise.\n    * **value** The response value, if any.\n    * **command** The command the response is for.\n* Returns: The `Client` instance.\n\n### Api\n\nThe monkey API implemented by `Client` and `Multi`.\n\n#### api.done(callback)\n\nCloses the current monkey session and allows a new session to connect.\n\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.flipClose(callback)\n\nSimulates closing the keyboard.\n\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.flipOpen(callback)\n\nSimulates opening the keyboard.\n\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.get(name, callback)\n\nGets the value of a variable. Use `api.list()` to retrieve a list of supported variables.\n\n* **name** The name of the variable.\n* **callback(err, value)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n    * **value** The value of the variable.\n* Returns: The `Api` implementation instance.\n\n#### api.getAmCurrentAction(callback)\n\nAlias for `api.get('am.current.action', callback)`.\n\n#### api.getAmCurrentCategories(callback)\n\nAlias for `api.get('am.current.categories', callback)`.\n\n#### api.getAmCurrentCompClass(callback)\n\nAlias for `api.get('am.current.comp.class', callback)`.\n\n#### api.getAmCurrentCompPackage(callback)\n\nAlias for `api.get('am.current.comp.package', callback)`.\n\n#### api.getCurrentData(callback)\n\nAlias for `api.get('am.current.data', callback)`.\n\n#### api.getAmCurrentPackage(callback)\n\nAlias for `api.get('am.current.package', callback)`.\n\n#### api.getBuildBoard(callback)\n\nAlias for `api.get('build.board', callback)`.\n\n#### api.getBuildBrand(callback)\n\nAlias for `api.get('build.brand', callback)`.\n\n#### api.getBuildCpuAbi(callback)\n\nAlias for `api.get('build.cpu_abi', callback)`.\n\n#### api.getBuildDevice(callback)\n\nAlias for `api.get('build.device', callback)`.\n\n#### api.getBuildDisplay(callback)\n\nAlias for `api.get('build.display', callback)`.\n\n#### api.getBuildFingerprint(callback)\n\nAlias for `api.get('build.fingerprint', callback)`.\n\n#### api.getBuildHost(callback)\n\nAlias for `api.get('build.host', callback)`.\n\n#### api.getBuildId(callback)\n\nAlias for `api.get('build.id', callback)`.\n\n#### api.getBuildManufacturer(callback)\n\nAlias for `api.get('build.manufacturer', callback)`.\n\n#### api.getBuildModel(callback)\n\nAlias for `api.get('build.model', callback)`.\n\n#### api.getBuildProduct(callback)\n\nAlias for `api.get('build.product', callback)`.\n\n#### api.getBuildTags(callback)\n\nAlias for `api.get('build.tags', callback)`.\n\n#### api.getBuildType(callback)\n\nAlias for `api.get('build.type', callback)`.\n\n#### api.getBuildUser(callback)\n\nAlias for `api.get('build.user', callback)`.\n\n#### api.getBuildVersionCodename(callback)\n\nAlias for `api.get('build.version.codename', callback)`.\n\n#### api.getBuildVersionIncremental(callback)\n\nAlias for `api.get('build.version.incremental', callback)`.\n\n#### api.getBuildVersionRelease(callback)\n\nAlias for `api.get('build.version.release', callback)`.\n\n#### api.getBuildVersionSdk(callback)\n\nAlias for `api.get('build.version.sdk', callback)`.\n\n#### api.getClockMillis(callback)\n\nAlias for `api.get('clock.millis', callback)`.\n\n#### api.getClockRealtime(callback)\n\nAlias for `api.get('clock.realtime', callback)`.\n\n#### api.getClockUptime(callback)\n\nAlias for `api.get('clock.uptime', callback)`.\n\n#### api.getDisplayDensity(callback)\n\nAlias for `api.get('display.density', callback)`.\n\n#### api.getDisplayHeight(callback)\n\nAlias for `api.get('display.height', callback)`. Note that the height may exclude any virtual home button row.\n\n#### api.getDisplayWidth(callback)\n\nAlias for `api.get('display.width', callback)`.\n\n#### api.keyDown(keyCode, callback)\n\nSends a key down event. Should be coupled with `api.keyUp()`. Note that `api.press()` performs the two events automatically.\n\n* **keyCode** The [key code][android-keycodes]. All monkeys support numeric keycodes, and some support automatic conversion from key names to key codes (e.g. `'home'` to `KEYCODE_HOME`). This will not work for number keys however. The most portable method is to simply use numeric key codes.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.keyUp(keyCode, callback)\n\nSends a key up event. Should be coupled with `api.keyDown()`. Note that `api.press()` performs the two events automatically.\n\n* **keyCode** See `api.keyDown()`.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.list(callback)\n\nLists supported variables.\n\n* **callback(err, vars)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n    * **vars** An array of supported variable names, to be used with `api.get()`.\n* Returns: The `Api` implementation instance.\n\n#### api.press(keyCode, callback)\n\nSends a key press event.\n\n* **keyCode** See `api.keyDown()`.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.quit(callback)\n\nCloses the current monkey session and quits monkey.\n\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.sleep(ms, callback)\n\nSleeps for the given duration. Can be useful for simulating gestures.\n\n* **ms** How many milliseconds to sleep for.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.tap(x, y, callback)\n\nTaps the given coordinates.\n\n* **x** The x coordinate.\n* **y** The y coordinate.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.touchDown(x, y, callback)\n\nSends a touch down event on the given coordinates.\n\n* **x** The x coordinate.\n* **y** The y coordinate.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.touchMove(x, y, callback)\n\nSends a touch move event on the given coordinates.\n\n* **x** The x coordinate.\n* **y** The y coordinate.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.touchUp(x, y, callback)\n\nSends a touch up event on the given coordinates.\n\n* **x** The x coordinate.\n* **y** The y coordinate.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.trackball(x, y, callback)\n\nSends a trackball event on the given coordinates.\n\n* **x** The x coordinate.\n* **y** The y coordinate.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.type(text, callback)\n\nTypes the given text.\n\n* **text** A text `String`. Note that only characters for which [key codes][android-keycodes] exist can be entered. Also note that any IME in use may or may not transform the text.\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n#### api.wake(callback)\n\nWakes the device from sleep and allows user input.\n\n* **callback(err)** Called when monkey responds.\n    * **err** `null` when successful, `Error` otherwise.\n* Returns: The `Api` implementation instance.\n\n### Multi\n\nBuffers `Api` commands and delivers them simultaneously for greater control over timing.\n\nImplements all `Api` methods, but without the last `callback` parameter.\n\n#### multi.execute(callback)\n\nSends all buffered commands.\n\n* **callback(err, values)** Called when monkey has responded to all commands (i.e. just once at the end).\n    * **err** `null` when successful, `Error` otherwise.\n    * **values** An array of all response values, identical to individual `Api` responses.\n\n## More information\n\n* [Monkey][monkey-site]\n    - [Source code][monkey-source]\n    - [Protocol][monkey-proto]\n* [Monkeyrunner][monkeyrunner-site]\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nSee [LICENSE](LICENSE).\n\nCopyright © CyberAgent, Inc. All Rights Reserved.\n\n[nodejs]: <http://nodejs.org/>\n[monkey-site]: <http://developer.android.com/tools/help/monkey.html>\n[monkey-source]: <https://github.com/android/platform_development/blob/master/cmds/monkey/>\n[monkey-proto]: <https://github.com/android/platform_development/blob/master/cmds/monkey/README.NETWORK.txt>\n[monkeyrunner-site]: <http://developer.android.com/tools/help/monkeyrunner_concepts.html>\n[node-net]: <http://nodejs.org/api/net.html>\n[node-stream]: <http://nodejs.org/api/stream.html>\n[android-keycodes]: <http://developer.android.com/reference/android/view/KeyEvent.html>","users":{}}