Commit Graph

11 Commits

Author SHA1 Message Date
Daniel Büchele
e33f72bb21 use adbkit instead of adbkit-fb
Summary: Finally we are able to switch back from our adbkit-fb fork to the original `adbkit`. Replacing all imports

Reviewed By: jknoxville

Differential Revision: D17343236

fbshipit-source-id: e6dd328f1a956544e8be2ab768aa270972463c6b
2019-09-13 05:28:31 -07:00
Daniel Büchele
b3de081f68 clear logs
Summary:
- clear logs using executeShell
- remove unused spawnShell

Reviewed By: jknoxville

Differential Revision: D17343235

fbshipit-source-id: 4353b2ebc00e35b31e815e405534a78b65a3eabb
2019-09-13 05:28:30 -07:00
Daniel Büchele
4e7cf077b8 adbkit typing
Summary: Adding proper types for adbkit (extracted from their documentation)

Reviewed By: passy

Differential Revision: D17342184

fbshipit-source-id: da0fc0264961ca3a0fa775ab5165d20872042eb8
2019-09-13 05:28:30 -07:00
Daniel Büchele
01be3dc5d1 refactor screen recording
Summary:
moving logic for screen recordings to the respective devices, instead of having it in the button component.
This is part of my wider effort to unify our use of adb/adbkit and upgrade to the latest version of adbkit.

Reviewed By: passy

Differential Revision: D17318702

fbshipit-source-id: cff4459047d7a197ed6cb8ee8c290b4eaab41479
2019-09-13 05:28:29 -07:00
Pascal Hartig
64373aac0a Fix formatting
Summary: Hmm, how did this land despite the formatting error?

Reviewed By: jknoxville

Differential Revision: D17342057

fbshipit-source-id: 514be1548feb024cc107139ac962b0d69ff42198
2019-09-12 08:03:13 -07:00
Pascal Hartig
4f6bae7cbf Make AndroidDevice strict
Summary:
Relies heavily on types (not) defined in other modules,
so right now it's mostly sprinkling more `any`s in.

My type declaration is based on `dts-gen` output and some
manual fixes. This is the same level as the old flow-typed
definition we had.

Reviewed By: jknoxville

Differential Revision: D17282739

fbshipit-source-id: 0e5015d3b61044615a03c50fefade908041310a8
2019-09-10 10:33:24 -07:00
Pascal Hartig
b19f08ba54 Fix promisify-child-process use
Summary: Per title. Somehow both typecheck, but importing the module like this doesn't work.

Reviewed By: jknoxville

Differential Revision: D17285507

fbshipit-source-id: 40a38db5dfb52213e0407f8bda83f2ebad5c50c7
2019-09-10 09:43:44 -07:00
Pascal Hartig
b90200e2aa Replace child-process promise version
Summary:
This one is in TS, so we get types for free.
`promisify` makes it rather awkward to work with overloaded
functions like `spawn`, so there's still value in having
a proper library for this.

Reviewed By: jknoxville

Differential Revision: D17204471

fbshipit-source-id: 3d07edfe2bb8c1e4c4f3134b53a0c4a0d9be383b
2019-09-09 07:04:54 -07:00
Pascal Hartig
4d7e776672 Refactor BaseDevice constructor
Summary: OS must always be defined.

Reviewed By: jknoxville

Differential Revision: D17204398

fbshipit-source-id: 0d84111c382af623843a41360bcb472394daf3f1
2019-09-09 07:04:54 -07:00
Benjamin Elo
7def9bb681 Moved screenshot functions into Device's class.
Summary:
I have moved the screenshot functions from ScreenCaptureButtons to the Device classes. I have slightly rewritten them so that they return a Promise which resolves to a Buffer. The Buffer can then be saved to a file or converted to a data Blob.

I have removed streaming and simply loaded the image into memory. Once the image is in memory it can be manipulated for various tasks i.e. written to a file, or displayed in the app.

iOS screenshots had to be rewritten. I now save the image to a temp folder, load it into the apps memory, and then remove the temp image.

Reviewed By: jknoxville

Differential Revision: D16939901

fbshipit-source-id: 3e39a5aeda8d48829ac5a8ff912a98f110341c07
2019-08-22 05:28:33 -07:00
Pritesh Nandgaonkar
eb26a74327 Migrate AndroidDevice from js to tsx
Summary: As per the title

Reviewed By: jknoxville

Differential Revision: D16667269

fbshipit-source-id: d213f4ebacf8050ae55a8e3268909da8535f2d93
2019-08-09 07:56:53 -07:00