docs(detox cli): update with new build-framework-cache api.

This commit is contained in:
Asaf Korem
2024-05-19 18:49:02 +03:00
parent 05557ad2f2
commit 96021f2a90
9 changed files with 32 additions and 83 deletions
+12 -4
View File
@@ -4,14 +4,17 @@
detox build-framework-cache
```
**MacOS only.** Builds a cached version of `Detox.framework` in `~/Library/Detox/ios/framework/*`.
**MacOS only.**
Builds or rebuilds a cached Detox framework and/or XCUITest-runner for the current environment in `~/Library/Detox`.
Supports `--build` and `--clean` options to specify what to build or clean. Defaults to building both without cleaning.
Detox stores a cached version of its framework in `~/Library/Detox/ios/framework/*` in unique folders, where the folder name
is a hash of Xcode and Detox version:
Detox stores a cached version of its framework and XCUITest-runner in `~/Library/Detox/ios/*` in unique folders, where the folder name
is a hash of Xcode and Detox version combination. This cache is used to speed up the build process and avoid unnecessary recompilations.
Here is an example of the cache structure:
```plain text
├── ios
│  ├── framework // <- here
│  ├── framework
│  │   ├── 197a0586bd006583562a5916c969d158133a8c50
│  │   ├── …
│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f
@@ -21,3 +24,8 @@ is a hash of Xcode and Detox version:
│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f
│…
```
## Options
- `--build` - Builds the cached framework and XCUITest-runner. Accepts `all`, `detox`, `xcuitest` or `none`. Defaults to `all`.
- `--clean` - Deletes the cached framework and XCUITest-runner. Accepts `all`, `detox`, `xcuitest` or `none`. Defaults to `none`.
-25
View File
@@ -1,25 +0,0 @@
# detox build-xcuitest-cache
```bash
detox build-xcuitest-cache
```
**MacOS only.** Builds a cached Detox XCUITest-runner for the current environment.
The cached runner is unique for each combination of Xcode and Detox version.
Detox stores a cached version of the runner in `~/Library/Detox/ios/xcuitest-runner/*` in unique folders, where the folder name
is a hash of Xcode and Detox version:
```plain text
├── ios
│  ├── framework
│  │   ├── 197a0586bd006583562a5916c969d158133a8c50
│  │   ├── …
│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f
│  ├── xcuitest-runner // <- here
|  │   ├── 197a0586bd006583562a5916c969d158133a8c50
│  │   ├── …
│  │   └── eddcc1edeffdb3533a977b73b667e1b7f106c38f
│…
```
+4 -1
View File
@@ -4,4 +4,7 @@
detox clean-framework-cache
```
**MacOS only.** Cleans cached versions of Detox XCUITest-runner in `~/Library/Detox/ios/xcuitest-runner/*`.
**MacOS only.**
Alias for `detox build-framework-cache --clean="all" --build="none"`. Deletes all Detox cached frameworks and XCUITest-runners from `~/Library/Detox`.
See also: [`detox build-framework-cache`](build-framework-cache.md)
-7
View File
@@ -1,7 +0,0 @@
# detox clean-xcuitest-cache
```bash
detox clean-xcuitest-cache
```
**MacOS only.** Cleans cached versions of `Detox.framework` in `~/Library/Detox/ios/framework/*`.
+11 -20
View File
@@ -18,20 +18,17 @@ detox <command> [options]
## Commands
| Command | Description |
| ------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [init] | Create initial E2E tests folder for Detox. |
| [build] | Run the command defined in 'build' property of the specified configuration. |
| [test] | Initiating your test suite. |
| [recorder] | Starts a [Detox Recorder](https://github.com/wix/DetoxRecorder) recording. |
| [build-framework-cache] | **MacOS only.** Builds Detox.framework to \~/Library/Detox. The framework cache is specific for each combination of Xcode and Detox versions. |
| [clean-framework-cache] | **MacOS only.** Deletes all compiled framework binaries from \~/Library/Detox, they will be rebuilt on 'npm install' or when running 'build-framework-cache'. |
| [rebuild-framework-cache] | **MacOS only.** Rebuilds the Detox cache. |
| [build-xcuitest-cache] | **MacOS only.** Builds the XCUITest runner cache. |
| [clean-xcuitest-cache] | **MacOS only.** Deletes the XCUITest runner cache. |
| [rebuild-xcuitest-cache] | **MacOS only.** Rebuilds the XCUITest runner cache. |
| [reset-lock-file] | Resets Detox lock file completely - all devices are marked as available after that. |
| [run-server] | Starts a standalone Detox server. |
| Command | Description |
| ------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [init] | Create initial E2E tests folder for Detox. |
| [build] | Run the command defined in 'build' property of the specified configuration. |
| [test] | Initiating your test suite. |
| [recorder] | Starts a [Detox Recorder](https://github.com/wix/DetoxRecorder) recording. |
| [build-framework-cache] | **MacOS only.** Builds or rebuilds a cached Detox framework and/or XCUITest-runner in ~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions. |
| [clean-framework-cache] | **MacOS only.** Deletes all compiled framework and XCUITest-runner binaries from \~/Library/Detox, they will be rebuilt on 'npm install' or when running 'build-framework-cache'. |
| [rebuild-framework-cache] | **MacOS only.** Cleans and builds a cached Detox framework and XCUITest-runner in \~/Library/Detox. The cache is specific for each combination of Xcode and Detox versions. |
| [reset-lock-file] | Resets Detox lock file completely - all devices are marked as available after that. |
| [run-server] | Starts a standalone Detox server. |
## Options
@@ -54,12 +51,6 @@ detox <command> [options]
[rebuild-framework-cache]: rebuild-framework-cache.md
[build-xcuitest-cache]: build-xcuitest-cache.md
[clean-xcuitest-cache]: clean-xcuitest-cache.md
[rebuild-xcuitest-cache]: rebuild-xcuitest-cache.md
[reset-lock-file]: reset-lock-file.md
[run-server]: run-server.md
+5 -3
View File
@@ -4,7 +4,9 @@
detox rebuild-framework-cache
```
**MacOS only.** This command is a shortcut for calling sequentially:
**MacOS only.**
Alias for `detox build-framework-cache --clean="all" --build="all"`.
Deletes all Detox cached frameworks and XCUITest-runners from `~/Library/Detox`,
and rebuilds a new one for the current environment.
1. [`detox clean-framework-cache`](clean-framework-cache.md)
1. [`detox build-framework-cache`](build-framework-cache.md)
See also: [`detox build-framework-cache`](build-framework-cache.md)
-10
View File
@@ -1,10 +0,0 @@
# detox rebuild-xcuitest-cache
```bash
detox rebuild-xcuitest-cache
```
**MacOS only.** This command is a shortcut for calling sequentially:
1. [`detox clean-xcuitest-cache`](clean-framework-cache.md)
1. [`detox build-xcuitest-cache`](build-framework-cache.md)
@@ -53,16 +53,6 @@ detox build-framework-cache
Note that it is only required when you change the native code of Detox, or one of its dependencies (e.g. [DetoxSync]).
If you are only changing the JavaScript code, you don't need to rebuild the framework.
### XCUITest Runner
Detox iOS also has a separate XCUITest runner (`DetoxXCUITestRunner`), which is built using the following command:
```bash
detox build-xcuitest-cache
```
Make sure to run this command after changing the native code of the XCUITest runner.
## Building the Detox Test App
The Detox self-test app is a full-feature React Native app for testing Detox end-to-end.
-3
View File
@@ -92,9 +92,6 @@ const sidebars = {
'cli/build-framework-cache',
'cli/clean-framework-cache',
'cli/rebuild-framework-cache',
'cli/build-xcuitest-cache',
'cli/clean-xcuitest-cache',
'cli/rebuild-xcuitest-cache',
'cli/reset-lock-file',
'cli/run-server',
]