adb record screen
Screen recording function using
Android Debug Bridge
(adb
).
Contents
Requirements
This is a thin wrapper around
adb and has no other
dependencies.
Installation
npm install adb-record-screen
Usage
const recordScreen = require('adb-record-screen')
const recording = recordScreen('/tmp/test.mp4', {
bugreport: true
})
recording.promise
.then(result => {
process.stdout.write(result.stdout)
process.stderr.write(result.stderr)
})
.catch(error => {
console.error(error)
})
setTimeout(() => recording.stop(), 5000)
Options
const defaultOptions = {
serial: undefined,
transportID: undefined,
hostname: undefined,
port: 5555,
waitTimeout: 5000,
bugreport: undefined,
size: undefined,
bitRate: 4000000,
timeLimit: 180,
pullDelay: 200
}
Testing
- Start Docker.
- Start Android Emulator.
- Install development dependencies:
npm install
- Run the tests:
npm test
License
Released under the MIT license.
Author
Sebastian Tschan