Skip to content

Commit 83522a7

Browse files
fix: unable to start iOS simulator when Android is not setup
In case CLI is used as a library, you need both Android and iOS to be setup in order to start simulator/emulator. The problem is that we check for errors in the setup before actually checking if we have found simulator/emulator with the specified name. Change the logic and do not raise errors in case the specified name/id is found. This way you can start iOS Simulator without having any Android setup on local machine.
1 parent 8e92c4e commit 83522a7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/common/mobile/mobile-core/devices-service.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
128128
const availableEmulatorsOutput = await this.getEmulatorImages({ platform: options.platform });
129129
const emulators = this.$emulatorHelper.getEmulatorsFromAvailableEmulatorsOutput(availableEmulatorsOutput);
130130
const errors = this.$emulatorHelper.getErrorsFromAvailableEmulatorsOutput(availableEmulatorsOutput);
131-
if (errors.length) {
132-
return errors;
133-
}
134131

135132
let emulator = null;
136133
if (options.imageIdentifier) {
@@ -140,7 +137,8 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
140137
}
141138

142139
if (!emulator) {
143-
return [`Unable to find emulator with provided options: ${options}`];
140+
const additionalErrors = errors && errors.length ? errors : [];
141+
return [`Unable to find emulator with provided options: ${options}`, ...additionalErrors];
144142
}
145143

146144
// emulator is already running

0 commit comments

Comments
 (0)