@@ -41,7 +41,11 @@ class TestExecutionService implements ITestExecutionService {
41
41
try {
42
42
let platformData = this . $platformsData . getPlatformData ( platform . toLowerCase ( ) , projectData ) ;
43
43
let projectDir = projectData . projectDir ;
44
- await this . $devicesService . initialize ( { platform : platform , deviceId : this . $options . device } ) ;
44
+ await this . $devicesService . initialize ( {
45
+ platform : platform ,
46
+ deviceId : this . $options . device ,
47
+ emulator : this . $options . emulator
48
+ } ) ;
45
49
await this . $devicesService . detectCurrentlyAttachedDevices ( ) ;
46
50
let projectFilesPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
47
51
@@ -59,6 +63,7 @@ class TestExecutionService implements ITestExecutionService {
59
63
if ( ! await this . $platformService . preparePlatform ( platform , appFilesUpdaterOptions , this . $options . platformTemplate , projectData , this . $options ) ) {
60
64
this . $errors . failWithoutHelp ( "Verify that listed files are well-formed and try again the operation." ) ;
61
65
}
66
+
62
67
this . detourEntryPoint ( projectFilesPath ) ;
63
68
64
69
const deployOptions : IDeployPlatformOptions = {
@@ -78,7 +83,8 @@ class TestExecutionService implements ITestExecutionService {
78
83
79
84
const devices = this . $devicesService . getDeviceInstances ( ) ;
80
85
// Now let's take data for each device:
81
- const deviceDescriptors : ILiveSyncDeviceInfo [ ] = devices . filter ( d => ! this . platform || d . deviceInfo . platform === this . platform )
86
+ const platformLowerCase = this . platform && this . platform . toLowerCase ( ) ;
87
+ const deviceDescriptors : ILiveSyncDeviceInfo [ ] = devices . filter ( d => ! platformLowerCase || d . deviceInfo . platform . toLowerCase ( ) === platformLowerCase )
82
88
. map ( d => {
83
89
const info : ILiveSyncDeviceInfo = {
84
90
identifier : d . deviceInfo . identifier ,
@@ -99,19 +105,16 @@ class TestExecutionService implements ITestExecutionService {
99
105
100
106
await this . $platformService . buildPlatform ( d . deviceInfo . platform , buildConfig , projectData ) ;
101
107
const pathToBuildResult = await this . $platformService . lastOutputPath ( d . deviceInfo . platform , buildConfig , projectData ) ;
102
- console . log ( "3##### return path to buildResult = " , pathToBuildResult ) ;
103
108
return pathToBuildResult ;
104
109
}
105
110
} ;
106
111
107
112
return info ;
108
113
} ) ;
109
114
110
- // TODO: Fix this call
111
115
const liveSyncInfo : ILiveSyncInfo = { projectDir : projectData . projectDir , skipWatcher : ! this . $options . watch || this . $options . justlaunch , watchAllFiles : this . $options . syncAllFiles } ;
116
+
112
117
await this . $liveSyncService . liveSync ( deviceDescriptors , liveSyncInfo ) ;
113
- // TODO: Fix
114
- // await this.$liveSyncService.liveSync(platform, projectData, null, this.$options);
115
118
116
119
if ( this . $options . debugBrk ) {
117
120
this . $logger . info ( 'Starting debugger...' ) ;
@@ -142,7 +145,11 @@ class TestExecutionService implements ITestExecutionService {
142
145
await this . $pluginsService . ensureAllDependenciesAreInstalled ( projectData ) ;
143
146
144
147
let projectDir = projectData . projectDir ;
145
- await this . $devicesService . initialize ( { platform : platform , deviceId : this . $options . device } ) ;
148
+ await this . $devicesService . initialize ( {
149
+ platform : platform ,
150
+ deviceId : this . $options . device ,
151
+ emulator : this . $options . emulator
152
+ } ) ;
146
153
147
154
let karmaConfig = this . getKarmaConfiguration ( platform , projectData ) ,
148
155
karmaRunner = this . $childProcess . fork ( path . join ( __dirname , "karma-execution.js" ) ) ,
@@ -187,13 +194,14 @@ class TestExecutionService implements ITestExecutionService {
187
194
} else {
188
195
const devices = this . $devicesService . getDeviceInstances ( ) ;
189
196
// Now let's take data for each device:
190
- const deviceDescriptors : ILiveSyncDeviceInfo [ ] = devices . filter ( d => ! this . platform || d . deviceInfo . platform === this . platform )
197
+ const platformLowerCase = this . platform && this . platform . toLowerCase ( ) ;
198
+ const deviceDescriptors : ILiveSyncDeviceInfo [ ] = devices . filter ( d => ! platformLowerCase || d . deviceInfo . platform . toLowerCase ( ) === platformLowerCase )
191
199
. map ( d => {
192
200
const info : ILiveSyncDeviceInfo = {
193
201
identifier : d . deviceInfo . identifier ,
194
202
buildAction : async ( ) : Promise < string > => {
195
203
const buildConfig : IBuildConfig = {
196
- buildForDevice : ! d . isEmulator , // this.$options.forDevice,
204
+ buildForDevice : ! d . isEmulator ,
197
205
projectDir : this . $options . path ,
198
206
clean : this . $options . clean ,
199
207
teamId : this . $options . teamId ,
@@ -208,15 +216,13 @@ class TestExecutionService implements ITestExecutionService {
208
216
209
217
await this . $platformService . buildPlatform ( d . deviceInfo . platform , buildConfig , projectData ) ;
210
218
const pathToBuildResult = await this . $platformService . lastOutputPath ( d . deviceInfo . platform , buildConfig , projectData ) ;
211
- console . log ( "3##### return path to buildResult = " , pathToBuildResult ) ;
212
219
return pathToBuildResult ;
213
220
}
214
221
} ;
215
222
216
223
return info ;
217
224
} ) ;
218
225
219
- // TODO: Fix this call
220
226
const liveSyncInfo : ILiveSyncInfo = { projectDir : projectData . projectDir , skipWatcher : ! this . $options . watch || this . $options . justlaunch , watchAllFiles : this . $options . syncAllFiles } ;
221
227
await this . $liveSyncService . liveSync ( deviceDescriptors , liveSyncInfo ) ;
222
228
}
0 commit comments