@mishguru/muppet
ADB utils
Last updated a year ago by stayradiated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mishguru/muppet 
SYNC missed versions from official npm registry.

@mishguru/muppet

Utils for remote controlling android phone

Device

import { device } from '@mishguru/muppet'

const deviceId = await device.firstDeviceIdAvailable()

await device.enableRoot(deviceId)

await device.runCommand(deviceId, 'echo hello world')

const buffer = await device.runCommandAndAll(deviceId, 'ls')

const string = await device.runCommandAndReadAllAsString('deviceId, ls')

await device.pullFile(deviceId, '/etc/passwd', './local/passwd.txt')

await device.pushFile(deviceId, './local/cache.tgz', '/data/cache.tgz')

await device.reboot(deviceId, )

Logger

import { logger } from '@mishguru/muppet'

logger.debug(message)
logger.verbose(message)
logger.info({ success: true })
logger.error(message)

poll

import { poll } from '@mishguru/muppet'

// repeatedly loop a function
// until it either returns true
// or 2 seconds have passed

const timedOut = await poll(2000, async () => {
  const result = await device.runCommandAndReadAllAsString(deviceId, 'cat /data/status')
  return /ready/.test(result)
})

if (timedOut) {
  // ...
}

Current Tags

  • 1.2.0                                ...           latest (a year ago)
  • 1.3.0-next.1                                ...           next (a year ago)

5 Versions

  • 1.3.0-next.1                                ...           a year ago
  • 1.3.0-next.0                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |