Skip to content

Commit 1e2109f

Browse files
committed
fix: avoid 30 seconds delay on each LiveSync
1 parent 2dfbeaa commit 1e2109f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/commands/test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
abstract class TestCommandBase {
22
public allowedParameters: ICommandParameter[] = [];
3+
public dashedOptions = {
4+
hmr: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
5+
};
6+
37
protected abstract platform: string;
48
protected abstract $projectData: IProjectData;
59
protected abstract $testExecutionService: ITestExecutionService;
@@ -50,6 +54,13 @@ abstract class TestCommandBase {
5054

5155
async canExecute(args: string[]): Promise<boolean | ICanExecuteCommandOutput> {
5256
if (!this.$options.force) {
57+
if (this.$options.hmr) {
58+
// With HMR we are not restarting after LiveSync which is causing a 30 seconds app start on Android
59+
// because the Runtime does not watch for the `/data/local/tmp<appId>-livesync-in-progress` file deletion.
60+
// The App is closing itself after each test execution and the bug will be reproducible on each LiveSync.
61+
this.$errors.fail("The `--hmr` option is not supported for this command.");
62+
}
63+
5364
await this.$migrateController.validate({ projectDir: this.$projectData.projectDir, platforms: [this.platform] });
5465
}
5566

0 commit comments

Comments
 (0)