1
1
import { Platform } from '@expo/eas-build-job' ;
2
2
import { BuildProfile , EasJsonAccessor } from '@expo/eas-json' ;
3
3
import { Errors , Flags } from '@oclif/core' ;
4
+ import chalk from 'chalk' ;
4
5
5
6
import {
6
7
createBuildProfileAsync ,
@@ -19,6 +20,7 @@ import Log from '../../log';
19
20
import { RequestedPlatform } from '../../platform' ;
20
21
import { resolveWorkflowAsync } from '../../project/workflow' ;
21
22
import { confirmAsync , promptAsync } from '../../prompts' ;
23
+ import { expoCommandAsync } from '../../utils/expoCli' ;
22
24
import { createFingerprintAsync } from '../../utils/fingerprintCli' ;
23
25
import { ProfileData , getProfilesAsync } from '../../utils/profiles' ;
24
26
import { Client } from '../../vcs/vcs' ;
@@ -122,6 +124,7 @@ export default class BuildDev extends EasCommand {
122
124
123
125
if ( build . artifacts ?. applicationArchiveUrl ) {
124
126
await downloadAndRunAsync ( build ) ;
127
+ await this . startDevServerAsync ( { projectDir, platform } ) ;
125
128
return ;
126
129
} else {
127
130
Log . warn ( 'Artifacts for this build expired. New build will be started.' ) ;
@@ -169,6 +172,7 @@ export default class BuildDev extends EasCommand {
169
172
downloadSimBuildAutoConfirm : true ,
170
173
envOverride : env ,
171
174
} ) ;
175
+ await this . startDevServerAsync ( { projectDir, platform } ) ;
172
176
}
173
177
174
178
private async selectPlatformAsync ( platform ?: Platform ) : Promise < Platform > {
@@ -324,4 +328,24 @@ export default class BuildDev extends EasCommand {
324
328
limit : 1 ,
325
329
} ) ;
326
330
}
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
+ }
327
351
}
0 commit comments