Detox icon indicating copy to clipboard operation
Detox copied to clipboard

(WIP) feat(Android): optimize app installation.

Open jonathanmos opened this issue 1 year ago • 0 comments

Description

Additional fixes on top of the original pr

Resolves https://github.com/wix/Detox/issues/3175 Resolves https://github.com/wix/Detox/issues/2537

Implemented only for Android.

  1. Improve APK install time by:
    • taking a hash of the binary that is being installed and writing it to the emulator as file whose filename is the binary name.
    • on the next install, checks whether the hash exists and if it does then clear user data without performing uninstall/install.
  2. Adds a new method of resetAppState to decide between clearing user data and reinstallation.
  3. Adds a boolean option to Detox behavior config, optimizeAppInstall with a corresponding CLI flag: --optimize-app-install.

In terms of performance: uninstall/install takes 6-7s, whereas clearing app state takes 400-600ms.

This pull request fixes #2534 .

For API changes:

  • [X ] I have made the necessary changes in the types index file.

jonathanmos avatar Jul 20 '22 13:07 jonathanmos