Skip to content

Commit 85a6662

Browse files
authored
[eas-cli] auto start dev client server at the end of eas build:dev (#2868)
<!-- If this PR requires a changelog entry, add it by commenting the PR with the command `/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]`. --> <!-- You can skip the changelog check by labeling the PR with "no changelog". --> # Why Auto-start dev client server at the end of `eas build:dev` command # How Auto-start dev client server at the end of `eas build:dev` command # Test Plan Tested manually [Screen Recording 2025-02-04 at 13.00.38.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/9YRXgAETSTRMfjZ0IP35/fabf33a3-77e4-474f-a5fe-71725446769f.mov" />](https://app.graphite.dev/media/video/9YRXgAETSTRMfjZ0IP35/fabf33a3-77e4-474f-a5fe-71725446769f.mov)
1 parent 8a2d68f commit 85a6662

File tree

1 file changed

+24
-0
lines changed
  • packages/eas-cli/src/commands/build

1 file changed

+24
-0
lines changed

packages/eas-cli/src/commands/build/dev.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Platform } from '@expo/eas-build-job';
22
import { BuildProfile, EasJsonAccessor } from '@expo/eas-json';
33
import { Errors, Flags } from '@oclif/core';
4+
import chalk from 'chalk';
45

56
import {
67
createBuildProfileAsync,
@@ -19,6 +20,7 @@ import Log from '../../log';
1920
import { RequestedPlatform } from '../../platform';
2021
import { resolveWorkflowAsync } from '../../project/workflow';
2122
import { confirmAsync, promptAsync } from '../../prompts';
23+
import { expoCommandAsync } from '../../utils/expoCli';
2224
import { createFingerprintAsync } from '../../utils/fingerprintCli';
2325
import { ProfileData, getProfilesAsync } from '../../utils/profiles';
2426
import { Client } from '../../vcs/vcs';
@@ -122,6 +124,7 @@ export default class BuildDev extends EasCommand {
122124

123125
if (build.artifacts?.applicationArchiveUrl) {
124126
await downloadAndRunAsync(build);
127+
await this.startDevServerAsync({ projectDir, platform });
125128
return;
126129
} else {
127130
Log.warn('Artifacts for this build expired. New build will be started.');
@@ -169,6 +172,7 @@ export default class BuildDev extends EasCommand {
169172
downloadSimBuildAutoConfirm: true,
170173
envOverride: env,
171174
});
175+
await this.startDevServerAsync({ projectDir, platform });
172176
}
173177

174178
private async selectPlatformAsync(platform?: Platform): Promise<Platform> {
@@ -324,4 +328,24 @@ export default class BuildDev extends EasCommand {
324328
limit: 1,
325329
});
326330
}
331+
332+
private async startDevServerAsync({
333+
projectDir,
334+
platform,
335+
}: {
336+
projectDir: string;
337+
platform: Platform;
338+
}): Promise<void> {
339+
Log.newLine();
340+
Log.log(
341+
`Starting development server: ${chalk.dim(
342+
`npx expo start --dev-client ${platform === Platform.IOS ? '--ios' : '--android'}`
343+
)}`
344+
);
345+
await expoCommandAsync(projectDir, [
346+
'start',
347+
'--dev-client',
348+
platform === Platform.IOS ? '--ios' : '--android',
349+
]);
350+
}
327351
}

0 commit comments

Comments
 (0)