function getDefaultSimulatorTarget()

in lib/build.js [83:99]


function getDefaultSimulatorTarget () {
    events.emit('log', 'Select last emulator from list as default.');
    return require('./listEmulatorBuildTargets').run()
        .then(emulators => {
            if (emulators.length === 0) {
                return Promise.reject(new CordovaError('Could not find any iOS simulators. Use Xcode to install simulator devices for testing.'));
            }

            let targetEmulator = emulators[0];
            emulators.forEach(emulator => {
                if (emulator.name.indexOf('iPhone') === 0) {
                    targetEmulator = emulator;
                }
            });
            return targetEmulator;
        });
}