Skip to content

Commit b09f23c

Browse files
FatmeFatme
authored andcommitted
Merge pull request #212 from NativeScript/fatme/improve-emulate-command
Don't trigger build if emulate iOS --availableDevices command is executed
2 parents 022b7df + 9a5cf99 commit b09f23c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/services/platform-service.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class PlatformService implements IPlatformService {
177177
platform = platform.toLowerCase();
178178

179179
this.preparePlatform(platform).wait();
180-
if (options.emulator) {
180+
if (options.emulator) {
181181
this.deployOnEmulator(platform).wait();
182182
} else {
183183
this.deployOnDevice(platform).wait();
@@ -291,12 +291,14 @@ export class PlatformService implements IPlatformService {
291291
emulatorServices.checkAvailability().wait();
292292
emulatorServices.checkDependencies().wait();
293293

294-
this.buildPlatform(platform).wait();
294+
if(!options.availableDevices) {
295+
this.buildPlatform(platform).wait();
295296

296-
var packageFile = this.getLatestApplicationPackageForEmulator(platformData).wait().packageName;
297-
this.$logger.out("Using ", packageFile);
297+
var packageFile = this.getLatestApplicationPackageForEmulator(platformData).wait().packageName;
298+
this.$logger.out("Using ", packageFile);
298299

299-
var logFilePath = path.join(platformData.projectRoot, this.$projectData.projectName, "emulator.log");
300+
var logFilePath = path.join(platformData.projectRoot, this.$projectData.projectName, "emulator.log");
301+
}
300302

301303
emulatorServices.startEmulator(packageFile, { stderrFilePath: logFilePath, stdoutFilePath: logFilePath, appId: this.$projectData.projectId }).wait();
302304
}).future<void>()();

0 commit comments

Comments
 (0)