nodejs-adb-wrapper
v1.4.0
Published
Node.js module to connect to Android device using ADB
Downloads
168
Readme
Node.JS Android Bridge wrapper
A Node.JS module to connect Android devices using ADB. Example:
Installation
npm install nodejs-adb-wrapper --save # use the library
Example
Check and run test.js for complete examples
Options
- ip - The device IP (mandatory)
- config: JSON object, contains:
- path - Path for adb binary (eq: '/usr/bin/' ), default: ''
- interval - Requests interval in milliseconds, default: 1000
- timeout - Request timeout in milliseconds, default: 1000
- playbackDelayOff - Playback delay before it considered there's no media playing, default: 10000
- retryPowerOn - How many retry before power on request considered failure, default: 10
- keycodePowerOn - Keycode to power on device, default: 'KEYCODE_POWER'
- keycodePowerOff - Keycode to power on device, default: 'KEYCODE_POWER'
Methods
sleep(ms)
Async helper for waiting in ms miliseconds
checkTail()
Check if Android device have tail
command.
return boolean
adbShell(params)
Wrapper to run ADB command
parameters Available parameters:
- params: string - the adb command, eg:
dumpsys
return { result, message }
- result: boolean - return true if the command succeded
- message: string - contain stdout/stderr output
osShell(params, [id])
Wrapper to run shell command
parameters Available parameters:
- params: string - the shell command, eg:
dumpsys
- id: string - process id
return { result, message }
- result: boolean - return true if the command succeded
- message: string - contain stdout/stderr output