@devicefarmer/adbkit 2.11.3 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +46 -0
- package/CONTRIBUTING.md +28 -0
- package/README.md +749 -759
- package/bin/adbkit +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +84 -0
- package/dist/src/Callback.d.ts +2 -0
- package/dist/src/Callback.d.ts.map +1 -0
- package/dist/src/Callback.js +3 -0
- package/dist/src/Callback.js.map +1 -0
- package/dist/src/ClientOptions.d.ts +6 -0
- package/dist/src/ClientOptions.d.ts.map +1 -0
- package/dist/src/ClientOptions.js +3 -0
- package/dist/src/ClientOptions.js.map +1 -0
- package/dist/src/CpuStats.d.ts +17 -0
- package/dist/src/CpuStats.d.ts.map +1 -0
- package/dist/src/CpuStats.js +3 -0
- package/dist/src/CpuStats.js.map +1 -0
- package/dist/src/Device.d.ts +5 -0
- package/dist/src/Device.d.ts.map +1 -0
- package/dist/src/Device.js +3 -0
- package/dist/src/Device.js.map +1 -0
- package/dist/src/DeviceWithPath.d.ts +9 -0
- package/dist/src/DeviceWithPath.d.ts.map +1 -0
- package/dist/src/DeviceWithPath.js +3 -0
- package/dist/src/DeviceWithPath.js.map +1 -0
- package/dist/src/ExtendedPublicKey.d.ts +7 -0
- package/dist/src/ExtendedPublicKey.d.ts.map +1 -0
- package/dist/src/ExtendedPublicKey.js +3 -0
- package/dist/src/ExtendedPublicKey.js.map +1 -0
- package/dist/src/Features.d.ts +2 -0
- package/dist/src/Features.d.ts.map +1 -0
- package/dist/src/Features.js +3 -0
- package/dist/src/Features.js.map +1 -0
- package/dist/src/Forward.d.ts +6 -0
- package/dist/src/Forward.d.ts.map +1 -0
- package/dist/src/Forward.js +3 -0
- package/dist/src/Forward.js.map +1 -0
- package/dist/src/FramebufferMeta.d.ts +60 -0
- package/dist/src/FramebufferMeta.d.ts.map +1 -0
- package/dist/src/FramebufferMeta.js +3 -0
- package/dist/src/FramebufferMeta.js.map +1 -0
- package/dist/src/FramebufferStreamWithMeta.d.ts +10 -0
- package/dist/src/FramebufferStreamWithMeta.d.ts.map +1 -0
- package/dist/src/FramebufferStreamWithMeta.js +3 -0
- package/dist/src/FramebufferStreamWithMeta.js.map +1 -0
- package/dist/src/Properties.d.ts +2 -0
- package/dist/src/Properties.d.ts.map +1 -0
- package/dist/src/Properties.js +3 -0
- package/dist/src/Properties.js.map +1 -0
- package/dist/src/Reverse.d.ts +5 -0
- package/dist/src/Reverse.d.ts.map +1 -0
- package/dist/src/Reverse.js +3 -0
- package/dist/src/Reverse.js.map +1 -0
- package/dist/src/SocketOptions.d.ts +6 -0
- package/dist/src/SocketOptions.d.ts.map +1 -0
- package/dist/src/SocketOptions.js +3 -0
- package/dist/src/SocketOptions.js.map +1 -0
- package/dist/src/StartActivityOptions.d.ts +12 -0
- package/dist/src/StartActivityOptions.d.ts.map +1 -0
- package/dist/src/StartActivityOptions.js +3 -0
- package/dist/src/StartActivityOptions.js.map +1 -0
- package/dist/src/StartServiceOptions.d.ts +57 -0
- package/dist/src/StartServiceOptions.d.ts.map +1 -0
- package/dist/src/StartServiceOptions.js +3 -0
- package/dist/src/StartServiceOptions.js.map +1 -0
- package/dist/src/TrackerChangeSet.d.ts +7 -0
- package/dist/src/TrackerChangeSet.d.ts.map +1 -0
- package/dist/src/TrackerChangeSet.js +3 -0
- package/dist/src/TrackerChangeSet.js.map +1 -0
- package/dist/src/WithToString.d.ts +4 -0
- package/dist/src/WithToString.d.ts.map +1 -0
- package/dist/src/WithToString.js +3 -0
- package/dist/src/WithToString.js.map +1 -0
- package/dist/src/adb/DeviceClient.d.ts +376 -0
- package/dist/src/adb/DeviceClient.d.ts.map +1 -0
- package/dist/src/adb/DeviceClient.js +517 -0
- package/dist/src/adb/DeviceClient.js.map +1 -0
- package/dist/src/adb/auth.d.ts +8 -0
- package/dist/src/adb/auth.d.ts.map +1 -0
- package/dist/src/adb/auth.js +87 -0
- package/dist/src/adb/auth.js.map +1 -0
- package/dist/src/adb/client.d.ts +29 -0
- package/dist/src/adb/client.d.ts.map +1 -0
- package/dist/src/adb/client.js +73 -0
- package/dist/src/adb/client.js.map +1 -0
- package/dist/src/adb/command/host/connect.d.ts +6 -0
- package/dist/src/adb/command/host/connect.d.ts.map +1 -0
- package/dist/src/adb/command/host/connect.js +36 -0
- package/dist/src/adb/command/host/connect.js.map +1 -0
- package/dist/src/adb/command/host/devices.d.ts +10 -0
- package/dist/src/adb/command/host/devices.d.ts.map +1 -0
- package/dist/src/adb/command/host/devices.js +40 -0
- package/dist/src/adb/command/host/devices.js.map +1 -0
- package/dist/src/adb/command/host/deviceswithpaths.d.ts +9 -0
- package/dist/src/adb/command/host/deviceswithpaths.d.ts.map +1 -0
- package/dist/src/adb/command/host/deviceswithpaths.js +46 -0
- package/dist/src/adb/command/host/deviceswithpaths.js.map +1 -0
- package/dist/src/adb/command/host/disconnect.d.ts +6 -0
- package/dist/src/adb/command/host/disconnect.d.ts.map +1 -0
- package/dist/src/adb/command/host/disconnect.js +35 -0
- package/dist/src/adb/command/host/disconnect.js.map +1 -0
- package/dist/src/adb/command/host/index.d.ts +9 -0
- package/dist/src/adb/command/host/index.d.ts.map +1 -0
- package/dist/src/adb/command/host/index.js +23 -0
- package/dist/src/adb/command/host/index.js.map +1 -0
- package/dist/src/adb/command/host/kill.d.ts +6 -0
- package/dist/src/adb/command/host/kill.d.ts.map +1 -0
- package/dist/src/adb/command/host/kill.js +24 -0
- package/dist/src/adb/command/host/kill.js.map +1 -0
- package/dist/src/adb/command/host/trackdevices.d.ts +6 -0
- package/dist/src/adb/command/host/trackdevices.d.ts.map +1 -0
- package/dist/src/adb/command/host/trackdevices.js +27 -0
- package/dist/src/adb/command/host/trackdevices.js.map +1 -0
- package/dist/src/adb/command/host/transport.d.ts +6 -0
- package/dist/src/adb/command/host/transport.d.ts.map +1 -0
- package/dist/src/adb/command/host/transport.js +24 -0
- package/dist/src/adb/command/host/transport.js.map +1 -0
- package/dist/src/adb/command/host/version.d.ts +7 -0
- package/dist/src/adb/command/host/version.d.ts.map +1 -0
- package/dist/src/adb/command/host/version.js +29 -0
- package/dist/src/adb/command/host/version.js.map +1 -0
- package/dist/src/adb/command/host-serial/forward.d.ts +6 -0
- package/dist/src/adb/command/host-serial/forward.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/forward.js +33 -0
- package/dist/src/adb/command/host-serial/forward.js.map +1 -0
- package/dist/src/adb/command/host-serial/getdevicepath.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getdevicepath.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getdevicepath.js +26 -0
- package/dist/src/adb/command/host-serial/getdevicepath.js.map +1 -0
- package/dist/src/adb/command/host-serial/getserialno.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getserialno.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getserialno.js +24 -0
- package/dist/src/adb/command/host-serial/getserialno.js.map +1 -0
- package/dist/src/adb/command/host-serial/getstate.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getstate.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getstate.js +24 -0
- package/dist/src/adb/command/host-serial/getstate.js.map +1 -0
- package/dist/src/adb/command/host-serial/index.d.ts +7 -0
- package/dist/src/adb/command/host-serial/index.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/index.js +19 -0
- package/dist/src/adb/command/host-serial/index.js.map +1 -0
- package/dist/src/adb/command/host-serial/listforwards.d.ts +8 -0
- package/dist/src/adb/command/host-serial/listforwards.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/listforwards.js +34 -0
- package/dist/src/adb/command/host-serial/listforwards.js.map +1 -0
- package/dist/src/adb/command/host-serial/waitfordevice.d.ts +6 -0
- package/dist/src/adb/command/host-serial/waitfordevice.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/waitfordevice.js +33 -0
- package/dist/src/adb/command/host-serial/waitfordevice.js.map +1 -0
- package/dist/src/adb/command/host-transport/clear.d.ts +6 -0
- package/dist/src/adb/command/host-transport/clear.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/clear.js +39 -0
- package/dist/src/adb/command/host-transport/clear.js.map +1 -0
- package/dist/src/adb/command/host-transport/framebuffer.d.ts +12 -0
- package/dist/src/adb/command/host-transport/framebuffer.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/framebuffer.js +113 -0
- package/dist/src/adb/command/host-transport/framebuffer.js.map +1 -0
- package/dist/src/adb/command/host-transport/getfeatures.d.ts +8 -0
- package/dist/src/adb/command/host-transport/getfeatures.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getfeatures.js +35 -0
- package/dist/src/adb/command/host-transport/getfeatures.js.map +1 -0
- package/dist/src/adb/command/host-transport/getpackages.d.ts +7 -0
- package/dist/src/adb/command/host-transport/getpackages.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getpackages.js +45 -0
- package/dist/src/adb/command/host-transport/getpackages.js.map +1 -0
- package/dist/src/adb/command/host-transport/getproperties.d.ts +8 -0
- package/dist/src/adb/command/host-transport/getproperties.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getproperties.js +37 -0
- package/dist/src/adb/command/host-transport/getproperties.js.map +1 -0
- package/dist/src/adb/command/host-transport/index.d.ts +28 -0
- package/dist/src/adb/command/host-transport/index.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/index.js +61 -0
- package/dist/src/adb/command/host-transport/index.js.map +1 -0
- package/dist/src/adb/command/host-transport/install.d.ts +6 -0
- package/dist/src/adb/command/host-transport/install.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/install.js +42 -0
- package/dist/src/adb/command/host-transport/install.js.map +1 -0
- package/dist/src/adb/command/host-transport/isinstalled.d.ts +6 -0
- package/dist/src/adb/command/host-transport/isinstalled.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/isinstalled.js +37 -0
- package/dist/src/adb/command/host-transport/isinstalled.js.map +1 -0
- package/dist/src/adb/command/host-transport/listreverses.d.ts +8 -0
- package/dist/src/adb/command/host-transport/listreverses.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/listreverses.js +38 -0
- package/dist/src/adb/command/host-transport/listreverses.js.map +1 -0
- package/dist/src/adb/command/host-transport/local.d.ts +8 -0
- package/dist/src/adb/command/host-transport/local.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/local.js +24 -0
- package/dist/src/adb/command/host-transport/local.js.map +1 -0
- package/dist/src/adb/command/host-transport/log.d.ts +8 -0
- package/dist/src/adb/command/host-transport/log.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/log.js +24 -0
- package/dist/src/adb/command/host-transport/log.js.map +1 -0
- package/dist/src/adb/command/host-transport/logcat.d.ts +9 -0
- package/dist/src/adb/command/host-transport/logcat.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/logcat.js +37 -0
- package/dist/src/adb/command/host-transport/logcat.js.map +1 -0
- package/dist/src/adb/command/host-transport/monkey.d.ts +8 -0
- package/dist/src/adb/command/host-transport/monkey.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/monkey.js +50 -0
- package/dist/src/adb/command/host-transport/monkey.js.map +1 -0
- package/dist/src/adb/command/host-transport/reboot.d.ts +6 -0
- package/dist/src/adb/command/host-transport/reboot.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/reboot.js +24 -0
- package/dist/src/adb/command/host-transport/reboot.js.map +1 -0
- package/dist/src/adb/command/host-transport/remount.d.ts +6 -0
- package/dist/src/adb/command/host-transport/remount.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/remount.js +24 -0
- package/dist/src/adb/command/host-transport/remount.js.map +1 -0
- package/dist/src/adb/command/host-transport/reverse.d.ts +6 -0
- package/dist/src/adb/command/host-transport/reverse.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/reverse.js +33 -0
- package/dist/src/adb/command/host-transport/reverse.js.map +1 -0
- package/dist/src/adb/command/host-transport/root.d.ts +6 -0
- package/dist/src/adb/command/host-transport/root.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/root.js +32 -0
- package/dist/src/adb/command/host-transport/root.js.map +1 -0
- package/dist/src/adb/command/host-transport/screencap.d.ts +8 -0
- package/dist/src/adb/command/host-transport/screencap.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/screencap.js +36 -0
- package/dist/src/adb/command/host-transport/screencap.js.map +1 -0
- package/dist/src/adb/command/host-transport/shell.d.ts +9 -0
- package/dist/src/adb/command/host-transport/shell.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/shell.js +27 -0
- package/dist/src/adb/command/host-transport/shell.js.map +1 -0
- package/dist/src/adb/command/host-transport/startactivity.d.ts +13 -0
- package/dist/src/adb/command/host-transport/startactivity.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/startactivity.js +166 -0
- package/dist/src/adb/command/host-transport/startactivity.js.map +1 -0
- package/dist/src/adb/command/host-transport/startservice.d.ts +7 -0
- package/dist/src/adb/command/host-transport/startservice.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/startservice.js +17 -0
- package/dist/src/adb/command/host-transport/startservice.js.map +1 -0
- package/dist/src/adb/command/host-transport/sync.d.ts +7 -0
- package/dist/src/adb/command/host-transport/sync.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/sync.js +25 -0
- package/dist/src/adb/command/host-transport/sync.js.map +1 -0
- package/dist/src/adb/command/host-transport/tcp.d.ts +8 -0
- package/dist/src/adb/command/host-transport/tcp.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/tcp.js +24 -0
- package/dist/src/adb/command/host-transport/tcp.js.map +1 -0
- package/dist/src/adb/command/host-transport/tcpip.d.ts +6 -0
- package/dist/src/adb/command/host-transport/tcpip.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/tcpip.js +32 -0
- package/dist/src/adb/command/host-transport/tcpip.js.map +1 -0
- package/dist/src/adb/command/host-transport/trackjdwp.d.ts +7 -0
- package/dist/src/adb/command/host-transport/trackjdwp.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/trackjdwp.js +25 -0
- package/dist/src/adb/command/host-transport/trackjdwp.js.map +1 -0
- package/dist/src/adb/command/host-transport/uninstall.d.ts +6 -0
- package/dist/src/adb/command/host-transport/uninstall.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/uninstall.js +40 -0
- package/dist/src/adb/command/host-transport/uninstall.js.map +1 -0
- package/dist/src/adb/command/host-transport/usb.d.ts +6 -0
- package/dist/src/adb/command/host-transport/usb.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/usb.js +32 -0
- package/dist/src/adb/command/host-transport/usb.js.map +1 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.d.ts +6 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.js +27 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.js.map +1 -0
- package/dist/src/adb/command.d.ts +17 -0
- package/dist/src/adb/command.d.ts.map +1 -0
- package/dist/src/adb/command.js +43 -0
- package/dist/src/adb/command.js.map +1 -0
- package/dist/src/adb/connection.d.ts +24 -0
- package/dist/src/adb/connection.d.ts.map +1 -0
- package/dist/src/adb/connection.js +115 -0
- package/dist/src/adb/connection.js.map +1 -0
- package/dist/src/adb/dump.d.ts +4 -0
- package/dist/src/adb/dump.d.ts.map +1 -0
- package/dist/src/adb/dump.js +38 -0
- package/dist/src/adb/dump.js.map +1 -0
- package/dist/src/adb/framebuffer/rgbtransform.d.ts +16 -0
- package/dist/src/adb/framebuffer/rgbtransform.d.ts.map +1 -0
- package/dist/src/adb/framebuffer/rgbtransform.js +47 -0
- package/dist/src/adb/framebuffer/rgbtransform.js.map +1 -0
- package/dist/src/adb/jdwptracker.d.ts +41 -0
- package/dist/src/adb/jdwptracker.d.ts.map +1 -0
- package/dist/src/adb/jdwptracker.js +85 -0
- package/dist/src/adb/jdwptracker.js.map +1 -0
- package/dist/src/adb/keycode.d.ts +292 -0
- package/dist/src/adb/keycode.d.ts.map +1 -0
- package/dist/src/adb/keycode.js +298 -0
- package/dist/src/adb/keycode.js.map +1 -0
- package/dist/src/adb/linetransform.d.ts +17 -0
- package/dist/src/adb/linetransform.d.ts.map +1 -0
- package/dist/src/adb/linetransform.js +93 -0
- package/dist/src/adb/linetransform.js.map +1 -0
- package/dist/src/adb/parser.d.ts +37 -0
- package/dist/src/adb/parser.d.ts.map +1 -0
- package/dist/src/adb/parser.js +269 -0
- package/dist/src/adb/parser.js.map +1 -0
- package/dist/src/adb/proc/stat.d.ts +30 -0
- package/dist/src/adb/proc/stat.d.ts.map +1 -0
- package/dist/src/adb/proc/stat.js +131 -0
- package/dist/src/adb/proc/stat.js.map +1 -0
- package/dist/src/adb/protocol.d.ts +17 -0
- package/dist/src/adb/protocol.d.ts.map +1 -0
- package/dist/src/adb/protocol.js +29 -0
- package/dist/src/adb/protocol.js.map +1 -0
- package/dist/src/adb/sync/entry.d.ts +8 -0
- package/dist/src/adb/sync/entry.d.ts.map +1 -0
- package/dist/src/adb/sync/entry.js +16 -0
- package/dist/src/adb/sync/entry.js.map +1 -0
- package/dist/src/adb/sync/pulltransfer.d.ts +10 -0
- package/dist/src/adb/sync/pulltransfer.d.ts.map +1 -0
- package/dist/src/adb/sync/pulltransfer.js +24 -0
- package/dist/src/adb/sync/pulltransfer.js.map +1 -0
- package/dist/src/adb/sync/pushtransfer.d.ts +13 -0
- package/dist/src/adb/sync/pushtransfer.d.ts.map +1 -0
- package/dist/src/adb/sync/pushtransfer.js +30 -0
- package/dist/src/adb/sync/pushtransfer.js.map +1 -0
- package/dist/src/adb/sync/stats.d.ts +23 -0
- package/dist/src/adb/sync/stats.d.ts.map +1 -0
- package/dist/src/adb/sync/stats.js +54 -0
- package/dist/src/adb/sync/stats.js.map +1 -0
- package/dist/src/adb/sync.d.ts +31 -0
- package/dist/src/adb/sync.d.ts.map +1 -0
- package/dist/src/adb/sync.js +322 -0
- package/dist/src/adb/sync.js.map +1 -0
- package/dist/src/adb/tcpusb/packet.d.ts +27 -0
- package/dist/src/adb/tcpusb/packet.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/packet.js +94 -0
- package/dist/src/adb/tcpusb/packet.js.map +1 -0
- package/dist/src/adb/tcpusb/packetreader.d.ts +26 -0
- package/dist/src/adb/tcpusb/packetreader.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/packetreader.js +100 -0
- package/dist/src/adb/tcpusb/packetreader.js.map +1 -0
- package/dist/src/adb/tcpusb/rollingcounter.d.ts +8 -0
- package/dist/src/adb/tcpusb/rollingcounter.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/rollingcounter.js +17 -0
- package/dist/src/adb/tcpusb/rollingcounter.js.map +1 -0
- package/dist/src/adb/tcpusb/server.d.ts +19 -0
- package/dist/src/adb/tcpusb/server.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/server.js +78 -0
- package/dist/src/adb/tcpusb/server.js.map +1 -0
- package/dist/src/adb/tcpusb/service.d.ts +37 -0
- package/dist/src/adb/tcpusb/service.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/service.js +173 -0
- package/dist/src/adb/tcpusb/service.js.map +1 -0
- package/dist/src/adb/tcpusb/servicemap.d.ts +10 -0
- package/dist/src/adb/tcpusb/servicemap.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/servicemap.js +42 -0
- package/dist/src/adb/tcpusb/servicemap.js.map +1 -0
- package/dist/src/adb/tcpusb/socket.d.ts +45 -0
- package/dist/src/adb/tcpusb/socket.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/socket.js +284 -0
- package/dist/src/adb/tcpusb/socket.js.map +1 -0
- package/dist/src/adb/tracker.d.ts +17 -0
- package/dist/src/adb/tracker.d.ts.map +1 -0
- package/dist/src/adb/tracker.js +72 -0
- package/dist/src/adb/tracker.js.map +1 -0
- package/dist/src/adb/util.d.ts +10 -0
- package/dist/src/adb/util.d.ts.map +1 -0
- package/dist/src/adb/util.js +17 -0
- package/dist/src/adb/util.js.map +1 -0
- package/dist/src/adb.d.ts +13 -0
- package/dist/src/adb.d.ts.map +1 -0
- package/dist/src/adb.js +28 -0
- package/dist/src/adb.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +86 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +53 -33
- package/.semaphore/publish.yml +0 -19
- package/.semaphore/semaphore.yml +0 -27
- package/index.js +0 -4
- package/lib/adb/auth.js +0 -78
- package/lib/adb/client.js +0 -576
- package/lib/adb/command/host/connect.js +0 -46
- package/lib/adb/command/host/devices.js +0 -64
- package/lib/adb/command/host/deviceswithpaths.js +0 -70
- package/lib/adb/command/host/disconnect.js +0 -46
- package/lib/adb/command/host/kill.js +0 -36
- package/lib/adb/command/host/trackdevices.js +0 -40
- package/lib/adb/command/host/transport.js +0 -36
- package/lib/adb/command/host/version.js +0 -42
- package/lib/adb/command/host-serial/forward.js +0 -45
- package/lib/adb/command/host-serial/getdevicepath.js +0 -38
- package/lib/adb/command/host-serial/getserialno.js +0 -38
- package/lib/adb/command/host-serial/getstate.js +0 -38
- package/lib/adb/command/host-serial/listforwards.js +0 -56
- package/lib/adb/command/host-serial/waitfordevice.js +0 -45
- package/lib/adb/command/host-transport/clear.js +0 -45
- package/lib/adb/command/host-transport/framebuffer.js +0 -114
- package/lib/adb/command/host-transport/getfeatures.js +0 -51
- package/lib/adb/command/host-transport/getpackages.js +0 -51
- package/lib/adb/command/host-transport/getproperties.js +0 -51
- package/lib/adb/command/host-transport/install.js +0 -48
- package/lib/adb/command/host-transport/isinstalled.js +0 -47
- package/lib/adb/command/host-transport/listreverses.js +0 -55
- package/lib/adb/command/host-transport/local.js +0 -36
- package/lib/adb/command/host-transport/log.js +0 -36
- package/lib/adb/command/host-transport/logcat.js +0 -48
- package/lib/adb/command/host-transport/monkey.js +0 -42
- package/lib/adb/command/host-transport/reboot.js +0 -36
- package/lib/adb/command/host-transport/remount.js +0 -36
- package/lib/adb/command/host-transport/reverse.js +0 -45
- package/lib/adb/command/host-transport/root.js +0 -46
- package/lib/adb/command/host-transport/screencap.js +0 -52
- package/lib/adb/command/host-transport/shell.js +0 -39
- package/lib/adb/command/host-transport/startactivity.js +0 -184
- package/lib/adb/command/host-transport/startservice.js +0 -33
- package/lib/adb/command/host-transport/sync.js +0 -38
- package/lib/adb/command/host-transport/tcp.js +0 -36
- package/lib/adb/command/host-transport/tcpip.js +0 -46
- package/lib/adb/command/host-transport/trackjdwp.js +0 -120
- package/lib/adb/command/host-transport/uninstall.js +0 -44
- package/lib/adb/command/host-transport/usb.js +0 -46
- package/lib/adb/command/host-transport/waitbootcomplete.js +0 -42
- package/lib/adb/command.js +0 -56
- package/lib/adb/connection.js +0 -117
- package/lib/adb/dump.js +0 -15
- package/lib/adb/framebuffer/rgbtransform.js +0 -55
- package/lib/adb/keycode.js +0 -225
- package/lib/adb/linetransform.js +0 -87
- package/lib/adb/parser.js +0 -291
- package/lib/adb/proc/stat.js +0 -137
- package/lib/adb/protocol.js +0 -45
- package/lib/adb/sync/entry.js +0 -23
- package/lib/adb/sync/pulltransfer.js +0 -31
- package/lib/adb/sync/pushtransfer.js +0 -40
- package/lib/adb/sync/stats.js +0 -54
- package/lib/adb/sync.js +0 -343
- package/lib/adb/tcpusb/packet.js +0 -112
- package/lib/adb/tcpusb/packetreader.js +0 -121
- package/lib/adb/tcpusb/rollingcounter.js +0 -21
- package/lib/adb/tcpusb/server.js +0 -79
- package/lib/adb/tcpusb/service.js +0 -203
- package/lib/adb/tcpusb/servicemap.js +0 -48
- package/lib/adb/tcpusb/socket.js +0 -312
- package/lib/adb/tracker.js +0 -89
- package/lib/adb/util.js +0 -13
- package/lib/adb.js +0 -29
- package/lib/cli.js +0 -66
package/lib/adb/client.js
DELETED
|
@@ -1,576 +0,0 @@
|
|
|
1
|
-
var ClearCommand, Client, Connection, EventEmitter, ForwardCommand, FrameBufferCommand, GetDevicePathCommand, GetFeaturesCommand, GetPackagesCommand, GetPropertiesCommand, GetSerialNoCommand, GetStateCommand, HostConnectCommand, HostDevicesCommand, HostDevicesWithPathsCommand, HostDisconnectCommand, HostKillCommand, HostTrackDevicesCommand, HostTransportCommand, HostVersionCommand, InstallCommand, IsInstalledCommand, ListForwardsCommand, ListReversesCommand, LocalCommand, LogCommand, Logcat, LogcatCommand, Monkey, MonkeyCommand, Parser, ProcStat, Promise, RebootCommand, RemountCommand, ReverseCommand, RootCommand, ScreencapCommand, ShellCommand, StartActivityCommand, StartServiceCommand, Sync, SyncCommand, TcpCommand, TcpIpCommand, TcpUsbServer, TrackJdwpCommand, UninstallCommand, UsbCommand, WaitBootCompleteCommand, WaitForDeviceCommand, debug,
|
|
2
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
3
|
-
hasProp = {}.hasOwnProperty;
|
|
4
|
-
|
|
5
|
-
Monkey = require('@devicefarmer/adbkit-monkey');
|
|
6
|
-
|
|
7
|
-
Logcat = require('@devicefarmer/adbkit-logcat');
|
|
8
|
-
|
|
9
|
-
Promise = require('bluebird');
|
|
10
|
-
|
|
11
|
-
EventEmitter = require('events').EventEmitter;
|
|
12
|
-
|
|
13
|
-
debug = require('debug')('adb:client');
|
|
14
|
-
|
|
15
|
-
Connection = require('./connection');
|
|
16
|
-
|
|
17
|
-
Sync = require('./sync');
|
|
18
|
-
|
|
19
|
-
Parser = require('./parser');
|
|
20
|
-
|
|
21
|
-
ProcStat = require('./proc/stat');
|
|
22
|
-
|
|
23
|
-
HostVersionCommand = require('./command/host/version');
|
|
24
|
-
|
|
25
|
-
HostConnectCommand = require('./command/host/connect');
|
|
26
|
-
|
|
27
|
-
HostDevicesCommand = require('./command/host/devices');
|
|
28
|
-
|
|
29
|
-
HostDevicesWithPathsCommand = require('./command/host/deviceswithpaths');
|
|
30
|
-
|
|
31
|
-
HostDisconnectCommand = require('./command/host/disconnect');
|
|
32
|
-
|
|
33
|
-
HostTrackDevicesCommand = require('./command/host/trackdevices');
|
|
34
|
-
|
|
35
|
-
HostKillCommand = require('./command/host/kill');
|
|
36
|
-
|
|
37
|
-
HostTransportCommand = require('./command/host/transport');
|
|
38
|
-
|
|
39
|
-
ClearCommand = require('./command/host-transport/clear');
|
|
40
|
-
|
|
41
|
-
FrameBufferCommand = require('./command/host-transport/framebuffer');
|
|
42
|
-
|
|
43
|
-
GetFeaturesCommand = require('./command/host-transport/getfeatures');
|
|
44
|
-
|
|
45
|
-
GetPackagesCommand = require('./command/host-transport/getpackages');
|
|
46
|
-
|
|
47
|
-
GetPropertiesCommand = require('./command/host-transport/getproperties');
|
|
48
|
-
|
|
49
|
-
InstallCommand = require('./command/host-transport/install');
|
|
50
|
-
|
|
51
|
-
IsInstalledCommand = require('./command/host-transport/isinstalled');
|
|
52
|
-
|
|
53
|
-
ListReversesCommand = require('./command/host-transport/listreverses');
|
|
54
|
-
|
|
55
|
-
LocalCommand = require('./command/host-transport/local');
|
|
56
|
-
|
|
57
|
-
LogcatCommand = require('./command/host-transport/logcat');
|
|
58
|
-
|
|
59
|
-
LogCommand = require('./command/host-transport/log');
|
|
60
|
-
|
|
61
|
-
MonkeyCommand = require('./command/host-transport/monkey');
|
|
62
|
-
|
|
63
|
-
RebootCommand = require('./command/host-transport/reboot');
|
|
64
|
-
|
|
65
|
-
RemountCommand = require('./command/host-transport/remount');
|
|
66
|
-
|
|
67
|
-
RootCommand = require('./command/host-transport/root');
|
|
68
|
-
|
|
69
|
-
ReverseCommand = require('./command/host-transport/reverse');
|
|
70
|
-
|
|
71
|
-
ScreencapCommand = require('./command/host-transport/screencap');
|
|
72
|
-
|
|
73
|
-
ShellCommand = require('./command/host-transport/shell');
|
|
74
|
-
|
|
75
|
-
StartActivityCommand = require('./command/host-transport/startactivity');
|
|
76
|
-
|
|
77
|
-
StartServiceCommand = require('./command/host-transport/startservice');
|
|
78
|
-
|
|
79
|
-
SyncCommand = require('./command/host-transport/sync');
|
|
80
|
-
|
|
81
|
-
TcpCommand = require('./command/host-transport/tcp');
|
|
82
|
-
|
|
83
|
-
TcpIpCommand = require('./command/host-transport/tcpip');
|
|
84
|
-
|
|
85
|
-
TrackJdwpCommand = require('./command/host-transport/trackjdwp');
|
|
86
|
-
|
|
87
|
-
UninstallCommand = require('./command/host-transport/uninstall');
|
|
88
|
-
|
|
89
|
-
UsbCommand = require('./command/host-transport/usb');
|
|
90
|
-
|
|
91
|
-
WaitBootCompleteCommand = require('./command/host-transport/waitbootcomplete');
|
|
92
|
-
|
|
93
|
-
ForwardCommand = require('./command/host-serial/forward');
|
|
94
|
-
|
|
95
|
-
GetDevicePathCommand = require('./command/host-serial/getdevicepath');
|
|
96
|
-
|
|
97
|
-
GetSerialNoCommand = require('./command/host-serial/getserialno');
|
|
98
|
-
|
|
99
|
-
GetStateCommand = require('./command/host-serial/getstate');
|
|
100
|
-
|
|
101
|
-
ListForwardsCommand = require('./command/host-serial/listforwards');
|
|
102
|
-
|
|
103
|
-
WaitForDeviceCommand = require('./command/host-serial/waitfordevice');
|
|
104
|
-
|
|
105
|
-
TcpUsbServer = require('./tcpusb/server');
|
|
106
|
-
|
|
107
|
-
Client = (function(superClass) {
|
|
108
|
-
var NoUserOptionError;
|
|
109
|
-
|
|
110
|
-
extend(Client, superClass);
|
|
111
|
-
|
|
112
|
-
function Client(options1) {
|
|
113
|
-
var base, base1;
|
|
114
|
-
this.options = options1 != null ? options1 : {};
|
|
115
|
-
(base = this.options).port || (base.port = 5037);
|
|
116
|
-
(base1 = this.options).bin || (base1.bin = 'adb');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
Client.prototype.createTcpUsbBridge = function(serial, options) {
|
|
120
|
-
return new TcpUsbServer(this, serial, options);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
Client.prototype.connection = function() {
|
|
124
|
-
var connection;
|
|
125
|
-
connection = new Connection(this.options);
|
|
126
|
-
connection.on('error', (function(_this) {
|
|
127
|
-
return function(err) {
|
|
128
|
-
return _this.emit('error', err);
|
|
129
|
-
};
|
|
130
|
-
})(this));
|
|
131
|
-
return connection.connect();
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
Client.prototype.version = function(callback) {
|
|
135
|
-
return this.connection().then(function(conn) {
|
|
136
|
-
return new HostVersionCommand(conn).execute();
|
|
137
|
-
}).nodeify(callback);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
Client.prototype.connect = function(host, port, callback) {
|
|
141
|
-
var ref;
|
|
142
|
-
if (port == null) {
|
|
143
|
-
port = 5555;
|
|
144
|
-
}
|
|
145
|
-
if (typeof port === 'function') {
|
|
146
|
-
callback = port;
|
|
147
|
-
port = 5555;
|
|
148
|
-
}
|
|
149
|
-
if (host.indexOf(':') !== -1) {
|
|
150
|
-
ref = host.split(':', 2), host = ref[0], port = ref[1];
|
|
151
|
-
}
|
|
152
|
-
return this.connection().then(function(conn) {
|
|
153
|
-
return new HostConnectCommand(conn).execute(host, port);
|
|
154
|
-
}).nodeify(callback);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
Client.prototype.disconnect = function(host, port, callback) {
|
|
158
|
-
var ref;
|
|
159
|
-
if (port == null) {
|
|
160
|
-
port = 5555;
|
|
161
|
-
}
|
|
162
|
-
if (typeof port === 'function') {
|
|
163
|
-
callback = port;
|
|
164
|
-
port = 5555;
|
|
165
|
-
}
|
|
166
|
-
if (host.indexOf(':') !== -1) {
|
|
167
|
-
ref = host.split(':', 2), host = ref[0], port = ref[1];
|
|
168
|
-
}
|
|
169
|
-
return this.connection().then(function(conn) {
|
|
170
|
-
return new HostDisconnectCommand(conn).execute(host, port);
|
|
171
|
-
}).nodeify(callback);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
Client.prototype.listDevices = function(callback) {
|
|
175
|
-
return this.connection().then(function(conn) {
|
|
176
|
-
return new HostDevicesCommand(conn).execute();
|
|
177
|
-
}).nodeify(callback);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
Client.prototype.listDevicesWithPaths = function(callback) {
|
|
181
|
-
return this.connection().then(function(conn) {
|
|
182
|
-
return new HostDevicesWithPathsCommand(conn).execute();
|
|
183
|
-
}).nodeify(callback);
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
Client.prototype.trackDevices = function(callback) {
|
|
187
|
-
return this.connection().then(function(conn) {
|
|
188
|
-
return new HostTrackDevicesCommand(conn).execute();
|
|
189
|
-
}).nodeify(callback);
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
Client.prototype.kill = function(callback) {
|
|
193
|
-
return this.connection().then(function(conn) {
|
|
194
|
-
return new HostKillCommand(conn).execute();
|
|
195
|
-
}).nodeify(callback);
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
Client.prototype.getSerialNo = function(serial, callback) {
|
|
199
|
-
return this.connection().then(function(conn) {
|
|
200
|
-
return new GetSerialNoCommand(conn).execute(serial);
|
|
201
|
-
}).nodeify(callback);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
Client.prototype.getDevicePath = function(serial, callback) {
|
|
205
|
-
return this.connection().then(function(conn) {
|
|
206
|
-
return new GetDevicePathCommand(conn).execute(serial);
|
|
207
|
-
}).nodeify(callback);
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
Client.prototype.getState = function(serial, callback) {
|
|
211
|
-
return this.connection().then(function(conn) {
|
|
212
|
-
return new GetStateCommand(conn).execute(serial);
|
|
213
|
-
}).nodeify(callback);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
Client.prototype.getProperties = function(serial, callback) {
|
|
217
|
-
return this.transport(serial).then(function(transport) {
|
|
218
|
-
return new GetPropertiesCommand(transport).execute();
|
|
219
|
-
}).nodeify(callback);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
Client.prototype.getFeatures = function(serial, callback) {
|
|
223
|
-
return this.transport(serial).then(function(transport) {
|
|
224
|
-
return new GetFeaturesCommand(transport).execute();
|
|
225
|
-
}).nodeify(callback);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
Client.prototype.getPackages = function(serial, callback) {
|
|
229
|
-
return this.transport(serial).then(function(transport) {
|
|
230
|
-
return new GetPackagesCommand(transport).execute();
|
|
231
|
-
}).nodeify(callback);
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
Client.prototype.getDHCPIpAddress = function(serial, iface, callback) {
|
|
235
|
-
if (iface == null) {
|
|
236
|
-
iface = 'wlan0';
|
|
237
|
-
}
|
|
238
|
-
if (typeof iface === 'function') {
|
|
239
|
-
callback = iface;
|
|
240
|
-
iface = 'wlan0';
|
|
241
|
-
}
|
|
242
|
-
return this.getProperties(serial).then(function(properties) {
|
|
243
|
-
var ip;
|
|
244
|
-
if (ip = properties["dhcp." + iface + ".ipaddress"]) {
|
|
245
|
-
return ip;
|
|
246
|
-
}
|
|
247
|
-
throw new Error("Unable to find ipaddress for '" + iface + "'");
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
Client.prototype.forward = function(serial, local, remote, callback) {
|
|
252
|
-
return this.connection().then(function(conn) {
|
|
253
|
-
return new ForwardCommand(conn).execute(serial, local, remote);
|
|
254
|
-
}).nodeify(callback);
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
Client.prototype.listForwards = function(serial, callback) {
|
|
258
|
-
return this.connection().then(function(conn) {
|
|
259
|
-
return new ListForwardsCommand(conn).execute(serial);
|
|
260
|
-
}).nodeify(callback);
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
Client.prototype.reverse = function(serial, remote, local, callback) {
|
|
264
|
-
return this.transport(serial).then(function(transport) {
|
|
265
|
-
return new ReverseCommand(transport).execute(remote, local).nodeify(callback);
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
Client.prototype.listReverses = function(serial, callback) {
|
|
270
|
-
return this.transport(serial).then(function(transport) {
|
|
271
|
-
return new ListReversesCommand(transport).execute();
|
|
272
|
-
}).nodeify(callback);
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
Client.prototype.transport = function(serial, callback) {
|
|
276
|
-
return this.connection().then(function(conn) {
|
|
277
|
-
return new HostTransportCommand(conn).execute(serial)["return"](conn);
|
|
278
|
-
}).nodeify(callback);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
Client.prototype.shell = function(serial, command, callback) {
|
|
282
|
-
return this.transport(serial).then(function(transport) {
|
|
283
|
-
return new ShellCommand(transport).execute(command);
|
|
284
|
-
}).nodeify(callback);
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
Client.prototype.reboot = function(serial, callback) {
|
|
288
|
-
return this.transport(serial).then(function(transport) {
|
|
289
|
-
return new RebootCommand(transport).execute();
|
|
290
|
-
}).nodeify(callback);
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
Client.prototype.remount = function(serial, callback) {
|
|
294
|
-
return this.transport(serial).then(function(transport) {
|
|
295
|
-
return new RemountCommand(transport).execute();
|
|
296
|
-
}).nodeify(callback);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
Client.prototype.root = function(serial, callback) {
|
|
300
|
-
return this.transport(serial).then(function(transport) {
|
|
301
|
-
return new RootCommand(transport).execute();
|
|
302
|
-
}).nodeify(callback);
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
Client.prototype.trackJdwp = function(serial, callback) {
|
|
306
|
-
return this.transport(serial).then(function(transport) {
|
|
307
|
-
return new TrackJdwpCommand(transport).execute();
|
|
308
|
-
}).nodeify(callback);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
Client.prototype.framebuffer = function(serial, format, callback) {
|
|
312
|
-
if (format == null) {
|
|
313
|
-
format = 'raw';
|
|
314
|
-
}
|
|
315
|
-
if (typeof format === 'function') {
|
|
316
|
-
callback = format;
|
|
317
|
-
format = 'raw';
|
|
318
|
-
}
|
|
319
|
-
return this.transport(serial).then(function(transport) {
|
|
320
|
-
return new FrameBufferCommand(transport).execute(format);
|
|
321
|
-
}).nodeify(callback);
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
Client.prototype.screencap = function(serial, callback) {
|
|
325
|
-
return this.transport(serial).then((function(_this) {
|
|
326
|
-
return function(transport) {
|
|
327
|
-
return new ScreencapCommand(transport).execute()["catch"](function(err) {
|
|
328
|
-
debug("Emulating screencap command due to '" + err + "'");
|
|
329
|
-
return _this.framebuffer(serial, 'png');
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
})(this)).nodeify(callback);
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
Client.prototype.openLocal = function(serial, path, callback) {
|
|
336
|
-
return this.transport(serial).then(function(transport) {
|
|
337
|
-
return new LocalCommand(transport).execute(path);
|
|
338
|
-
}).nodeify(callback);
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
Client.prototype.openLog = function(serial, name, callback) {
|
|
342
|
-
return this.transport(serial).then(function(transport) {
|
|
343
|
-
return new LogCommand(transport).execute(name);
|
|
344
|
-
}).nodeify(callback);
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
Client.prototype.openTcp = function(serial, port, host, callback) {
|
|
348
|
-
if (typeof host === 'function') {
|
|
349
|
-
callback = host;
|
|
350
|
-
host = void 0;
|
|
351
|
-
}
|
|
352
|
-
return this.transport(serial).then(function(transport) {
|
|
353
|
-
return new TcpCommand(transport).execute(port, host);
|
|
354
|
-
}).nodeify(callback);
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
Client.prototype.openMonkey = function(serial, port, callback) {
|
|
358
|
-
var tryConnect;
|
|
359
|
-
if (port == null) {
|
|
360
|
-
port = 1080;
|
|
361
|
-
}
|
|
362
|
-
if (typeof port === 'function') {
|
|
363
|
-
callback = port;
|
|
364
|
-
port = 1080;
|
|
365
|
-
}
|
|
366
|
-
tryConnect = (function(_this) {
|
|
367
|
-
return function(times) {
|
|
368
|
-
return _this.openTcp(serial, port).then(function(stream) {
|
|
369
|
-
return Monkey.connectStream(stream);
|
|
370
|
-
})["catch"](function(err) {
|
|
371
|
-
if (times -= 1) {
|
|
372
|
-
debug("Monkey can't be reached, trying " + times + " more times");
|
|
373
|
-
return Promise.delay(100).then(function() {
|
|
374
|
-
return tryConnect(times);
|
|
375
|
-
});
|
|
376
|
-
} else {
|
|
377
|
-
throw err;
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
};
|
|
381
|
-
})(this);
|
|
382
|
-
return tryConnect(1)["catch"]((function(_this) {
|
|
383
|
-
return function(err) {
|
|
384
|
-
return _this.transport(serial).then(function(transport) {
|
|
385
|
-
return new MonkeyCommand(transport).execute(port);
|
|
386
|
-
}).then(function(out) {
|
|
387
|
-
return tryConnect(20).then(function(monkey) {
|
|
388
|
-
return monkey.once('end', function() {
|
|
389
|
-
return out.end();
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
};
|
|
394
|
-
})(this)).nodeify(callback);
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
Client.prototype.openLogcat = function(serial, options, callback) {
|
|
398
|
-
if (typeof options === 'function') {
|
|
399
|
-
callback = options;
|
|
400
|
-
options = {};
|
|
401
|
-
}
|
|
402
|
-
return this.transport(serial).then(function(transport) {
|
|
403
|
-
return new LogcatCommand(transport).execute(options);
|
|
404
|
-
}).then(function(stream) {
|
|
405
|
-
return Logcat.readStream(stream, {
|
|
406
|
-
fixLineFeeds: false
|
|
407
|
-
});
|
|
408
|
-
}).nodeify(callback);
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
Client.prototype.openProcStat = function(serial, callback) {
|
|
412
|
-
return this.syncService(serial).then(function(sync) {
|
|
413
|
-
return new ProcStat(sync);
|
|
414
|
-
}).nodeify(callback);
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
Client.prototype.clear = function(serial, pkg, callback) {
|
|
418
|
-
return this.transport(serial).then(function(transport) {
|
|
419
|
-
return new ClearCommand(transport).execute(pkg);
|
|
420
|
-
}).nodeify(callback);
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
Client.prototype.install = function(serial, apk, callback) {
|
|
424
|
-
var temp;
|
|
425
|
-
temp = Sync.temp(typeof apk === 'string' ? apk : '_stream.apk');
|
|
426
|
-
return this.push(serial, apk, temp).then((function(_this) {
|
|
427
|
-
return function(transfer) {
|
|
428
|
-
var endListener, errorListener, resolver;
|
|
429
|
-
resolver = Promise.defer();
|
|
430
|
-
transfer.on('error', errorListener = function(err) {
|
|
431
|
-
return resolver.reject(err);
|
|
432
|
-
});
|
|
433
|
-
transfer.on('end', endListener = function() {
|
|
434
|
-
return resolver.resolve(_this.installRemote(serial, temp));
|
|
435
|
-
});
|
|
436
|
-
return resolver.promise["finally"](function() {
|
|
437
|
-
transfer.removeListener('error', errorListener);
|
|
438
|
-
return transfer.removeListener('end', endListener);
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
})(this)).nodeify(callback);
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
Client.prototype.installRemote = function(serial, apk, callback) {
|
|
445
|
-
return this.transport(serial).then((function(_this) {
|
|
446
|
-
return function(transport) {
|
|
447
|
-
return new InstallCommand(transport).execute(apk).then(function() {
|
|
448
|
-
return _this.shell(serial, ['rm', '-f', apk]);
|
|
449
|
-
}).then(function(stream) {
|
|
450
|
-
return new Parser(stream).readAll();
|
|
451
|
-
}).then(function(out) {
|
|
452
|
-
return true;
|
|
453
|
-
});
|
|
454
|
-
};
|
|
455
|
-
})(this)).nodeify(callback);
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
Client.prototype.uninstall = function(serial, pkg, callback) {
|
|
459
|
-
return this.transport(serial).then(function(transport) {
|
|
460
|
-
return new UninstallCommand(transport).execute(pkg);
|
|
461
|
-
}).nodeify(callback);
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
Client.prototype.isInstalled = function(serial, pkg, callback) {
|
|
465
|
-
return this.transport(serial).then(function(transport) {
|
|
466
|
-
return new IsInstalledCommand(transport).execute(pkg);
|
|
467
|
-
}).nodeify(callback);
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
Client.prototype.startActivity = function(serial, options, callback) {
|
|
471
|
-
return this.transport(serial).then(function(transport) {
|
|
472
|
-
return new StartActivityCommand(transport).execute(options);
|
|
473
|
-
})["catch"](NoUserOptionError, (function(_this) {
|
|
474
|
-
return function() {
|
|
475
|
-
options.user = null;
|
|
476
|
-
return _this.startActivity(serial, options);
|
|
477
|
-
};
|
|
478
|
-
})(this)).nodeify(callback);
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
Client.prototype.startService = function(serial, options, callback) {
|
|
482
|
-
return this.transport(serial).then(function(transport) {
|
|
483
|
-
if (!(options.user || options.user === null)) {
|
|
484
|
-
options.user = 0;
|
|
485
|
-
}
|
|
486
|
-
return new StartServiceCommand(transport).execute(options);
|
|
487
|
-
})["catch"](NoUserOptionError, (function(_this) {
|
|
488
|
-
return function() {
|
|
489
|
-
options.user = null;
|
|
490
|
-
return _this.startService(serial, options);
|
|
491
|
-
};
|
|
492
|
-
})(this)).nodeify(callback);
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
Client.prototype.syncService = function(serial, callback) {
|
|
496
|
-
return this.transport(serial).then(function(transport) {
|
|
497
|
-
return new SyncCommand(transport).execute();
|
|
498
|
-
}).nodeify(callback);
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
Client.prototype.stat = function(serial, path, callback) {
|
|
502
|
-
return this.syncService(serial).then(function(sync) {
|
|
503
|
-
return sync.stat(path)["finally"](function() {
|
|
504
|
-
return sync.end();
|
|
505
|
-
});
|
|
506
|
-
}).nodeify(callback);
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
Client.prototype.readdir = function(serial, path, callback) {
|
|
510
|
-
return this.syncService(serial).then(function(sync) {
|
|
511
|
-
return sync.readdir(path)["finally"](function() {
|
|
512
|
-
return sync.end();
|
|
513
|
-
});
|
|
514
|
-
}).nodeify(callback);
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
Client.prototype.pull = function(serial, path, callback) {
|
|
518
|
-
return this.syncService(serial).then(function(sync) {
|
|
519
|
-
return sync.pull(path).on('end', function() {
|
|
520
|
-
return sync.end();
|
|
521
|
-
});
|
|
522
|
-
}).nodeify(callback);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
Client.prototype.push = function(serial, contents, path, mode, callback) {
|
|
526
|
-
if (typeof mode === 'function') {
|
|
527
|
-
callback = mode;
|
|
528
|
-
mode = void 0;
|
|
529
|
-
}
|
|
530
|
-
return this.syncService(serial).then(function(sync) {
|
|
531
|
-
return sync.push(contents, path, mode).on('end', function() {
|
|
532
|
-
return sync.end();
|
|
533
|
-
});
|
|
534
|
-
}).nodeify(callback);
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
Client.prototype.tcpip = function(serial, port, callback) {
|
|
538
|
-
if (port == null) {
|
|
539
|
-
port = 5555;
|
|
540
|
-
}
|
|
541
|
-
if (typeof port === 'function') {
|
|
542
|
-
callback = port;
|
|
543
|
-
port = 5555;
|
|
544
|
-
}
|
|
545
|
-
return this.transport(serial).then(function(transport) {
|
|
546
|
-
return new TcpIpCommand(transport).execute(port);
|
|
547
|
-
}).nodeify(callback);
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
Client.prototype.usb = function(serial, callback) {
|
|
551
|
-
return this.transport(serial).then(function(transport) {
|
|
552
|
-
return new UsbCommand(transport).execute();
|
|
553
|
-
}).nodeify(callback);
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
Client.prototype.waitBootComplete = function(serial, callback) {
|
|
557
|
-
return this.transport(serial).then(function(transport) {
|
|
558
|
-
return new WaitBootCompleteCommand(transport).execute();
|
|
559
|
-
}).nodeify(callback);
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
Client.prototype.waitForDevice = function(serial, callback) {
|
|
563
|
-
return this.connection().then(function(conn) {
|
|
564
|
-
return new WaitForDeviceCommand(conn).execute(serial);
|
|
565
|
-
}).nodeify(callback);
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
NoUserOptionError = function(err) {
|
|
569
|
-
return err.message.indexOf('--user') !== -1;
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
return Client;
|
|
573
|
-
|
|
574
|
-
})(EventEmitter);
|
|
575
|
-
|
|
576
|
-
module.exports = Client;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var Command, ConnectCommand, Protocol,
|
|
2
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
3
|
-
hasProp = {}.hasOwnProperty;
|
|
4
|
-
|
|
5
|
-
Command = require('../../command');
|
|
6
|
-
|
|
7
|
-
Protocol = require('../../protocol');
|
|
8
|
-
|
|
9
|
-
ConnectCommand = (function(superClass) {
|
|
10
|
-
var RE_OK;
|
|
11
|
-
|
|
12
|
-
extend(ConnectCommand, superClass);
|
|
13
|
-
|
|
14
|
-
function ConnectCommand() {
|
|
15
|
-
return ConnectCommand.__super__.constructor.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
RE_OK = /connected to|already connected/;
|
|
19
|
-
|
|
20
|
-
ConnectCommand.prototype.execute = function(host, port) {
|
|
21
|
-
this._send("host:connect:" + host + ":" + port);
|
|
22
|
-
return this.parser.readAscii(4).then((function(_this) {
|
|
23
|
-
return function(reply) {
|
|
24
|
-
switch (reply) {
|
|
25
|
-
case Protocol.OKAY:
|
|
26
|
-
return _this.parser.readValue().then(function(value) {
|
|
27
|
-
if (RE_OK.test(value)) {
|
|
28
|
-
return host + ":" + port;
|
|
29
|
-
} else {
|
|
30
|
-
throw new Error(value.toString());
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
case Protocol.FAIL:
|
|
34
|
-
return _this.parser.readError();
|
|
35
|
-
default:
|
|
36
|
-
return _this.parser.unexpected(reply, 'OKAY or FAIL');
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
})(this));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return ConnectCommand;
|
|
43
|
-
|
|
44
|
-
})(Command);
|
|
45
|
-
|
|
46
|
-
module.exports = ConnectCommand;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var Command, HostDevicesCommand, Protocol,
|
|
2
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
3
|
-
hasProp = {}.hasOwnProperty;
|
|
4
|
-
|
|
5
|
-
Command = require('../../command');
|
|
6
|
-
|
|
7
|
-
Protocol = require('../../protocol');
|
|
8
|
-
|
|
9
|
-
HostDevicesCommand = (function(superClass) {
|
|
10
|
-
extend(HostDevicesCommand, superClass);
|
|
11
|
-
|
|
12
|
-
function HostDevicesCommand() {
|
|
13
|
-
return HostDevicesCommand.__super__.constructor.apply(this, arguments);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
HostDevicesCommand.prototype.execute = function() {
|
|
17
|
-
this._send('host:devices');
|
|
18
|
-
return this.parser.readAscii(4).then((function(_this) {
|
|
19
|
-
return function(reply) {
|
|
20
|
-
switch (reply) {
|
|
21
|
-
case Protocol.OKAY:
|
|
22
|
-
return _this._readDevices();
|
|
23
|
-
case Protocol.FAIL:
|
|
24
|
-
return _this.parser.readError();
|
|
25
|
-
default:
|
|
26
|
-
return _this.parser.unexpected(reply, 'OKAY or FAIL');
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
})(this));
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
HostDevicesCommand.prototype._readDevices = function() {
|
|
33
|
-
return this.parser.readValue().then((function(_this) {
|
|
34
|
-
return function(value) {
|
|
35
|
-
return _this._parseDevices(value);
|
|
36
|
-
};
|
|
37
|
-
})(this));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
HostDevicesCommand.prototype._parseDevices = function(value) {
|
|
41
|
-
var devices, i, id, len, line, ref, ref1, type;
|
|
42
|
-
devices = [];
|
|
43
|
-
if (!value.length) {
|
|
44
|
-
return devices;
|
|
45
|
-
}
|
|
46
|
-
ref = value.toString('ascii').split('\n');
|
|
47
|
-
for (i = 0, len = ref.length; i < len; i++) {
|
|
48
|
-
line = ref[i];
|
|
49
|
-
if (line) {
|
|
50
|
-
ref1 = line.split('\t'), id = ref1[0], type = ref1[1];
|
|
51
|
-
devices.push({
|
|
52
|
-
id: id,
|
|
53
|
-
type: type
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return devices;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return HostDevicesCommand;
|
|
61
|
-
|
|
62
|
-
})(Command);
|
|
63
|
-
|
|
64
|
-
module.exports = HostDevicesCommand;
|