Skip to content

Commit

Permalink
(ios): add console output for simulator selection (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasMerz authored Jan 19, 2021
1 parent fb999cb commit fb5fd2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/templates/scripts/cordova/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function createProjectObject (projectPath, projectName) {
* @return {Promise}
*/
function getDefaultSimulatorTarget () {
events.emit('log', 'Select last emulator from list as default.');
return require('./listEmulatorBuildTargets').run()
.then(emulators => {
let targetEmulator;
Expand Down
5 changes: 3 additions & 2 deletions bin/templates/scripts/cordova/lib/listEmulatorBuildTargets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const { superspawn: { spawn } } = require('cordova-common');
const { superspawn: { spawn }, events } = require('cordova-common');

/**
* Returns a list of available simulator build targets of the form
Expand All @@ -31,7 +31,8 @@ const { superspawn: { spawn } } = require('cordova-common');
*
*/
function listEmulatorBuildTargets () {
return spawn('xcrun', ['simctl', 'list', '--json'])
events.emit('log', 'List simulator targets');
return spawn('xcrun', ['simctl', 'list', '--json'], { printCommand: true })
.then(output => JSON.parse(output))
.then(function (simInfo) {
var devices = simInfo.devices;
Expand Down

0 comments on commit fb5fd2f

Please sign in to comment.