From 2b823bb977c481864dda8c2b61f4fb715d0d3320 Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Tue, 27 Oct 2015 18:10:40 -0500 Subject: [PATCH] v0.8.2. Fixed TIMOB-19799 where finding a simulator fails if Xcode is installed, but not launched the EULA not accepted. --- lib/simulator.js | 8 +++++++- package.json | 14 +++++++------- test/test-simulator.js | 8 ++++++-- test/test-xcode.js | 4 +++- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/lib/simulator.js b/lib/simulator.js index 3dc93e9..3b73c34 100644 --- a/lib/simulator.js +++ b/lib/simulator.js @@ -600,7 +600,7 @@ function findSimulators(options, callback) { // loop through each xcode simulators for (var j = 0; !simHandle && j < simVers.length; j++) { - if (!options.simVersion || simVers[j] === options.simVersion) { + if ((!options.simVersion || simVers[j] === options.simVersion) && simInfo.simulators.ios[simVers[j]]) { var sims = simInfo.simulators.ios[simVers[j]].sort(compareSims).reverse(); // loop through each simulator @@ -782,6 +782,12 @@ function launch(simHandleOrUDID, options, callback) { return callback(err); } + if (!selectedXcode.eulaAccepted) { + var eulaErr = new Error(__('Xcode must be launched and the EULA must be accepted before a simulator can be launched.')); + emitter.emit('error', eulaErr); + return callback(eulaErr); + } + var crashFileRegExp, existingCrashes = getCrashes(), findLogTimer = null, diff --git a/package.json b/package.json index b381724..780fa63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ioslib", - "version": "0.8.1", + "version": "0.8.2", "description": "iOS Utility Library", "keywords": [ "appcelerator", @@ -37,16 +37,16 @@ "lib": "./lib" }, "dependencies": { - "always-tail": "0.1.1", - "async": "1.4.2", + "always-tail": "0.2.0", + "async": "1.5.0", "bplist-parser": "0.1.0", "mkdirp": "0.5.1", - "node-appc": "0.2.32", - "node-ios-device": "0.5.2" + "node-appc": "0.2.33", + "node-ios-device": "0.6.0" }, "devDependencies": { - "mocha": "^2.3.2", - "should": "^7.1.0" + "mocha": "^2.3.3", + "should": "^7.1.1" }, "scripts": { "test": "mocha --require test/init --reporter spec --check-leaks test/", diff --git a/test/test-simulator.js b/test/test-simulator.js index 04470ff..9f355b9 100644 --- a/test/test-simulator.js +++ b/test/test-simulator.js @@ -75,6 +75,10 @@ function build(app, iosVersion, defs, done){ return done(new Error('No selected Xcode')); } + if (!xc.eulaAccepted) { + return done(new Error('Xcode must be launched and the EULA must be accepted before the iOS app can be compiled.')); + } + var args = [ xc.executables.xcodebuild, 'clean', 'build', @@ -702,7 +706,7 @@ describe('simulator', function () { }); }); - (process.env.TRAVIS ? it.skip : it.only)('should be able to launch simulator and log basic logs', function (done) { + (process.env.TRAVIS ? it.skip : it)('should be able to launch simulator and log basic logs', function (done) { this.timeout(60000); this.slow(60000); @@ -1015,4 +1019,4 @@ describe('simulator', function () { }); }); -}); \ No newline at end of file +}); diff --git a/test/test-xcode.js b/test/test-xcode.js index 7b5f9a7..f8ac2d4 100644 --- a/test/test-xcode.js +++ b/test/test-xcode.js @@ -130,7 +130,9 @@ describe('xcode', function () { should(results.xcode).be.an.Object; should(results.issues).be.an.Array; - checkXcode(results.selectedXcode); + if (results.selectedXcode !== null) { + checkXcode(results.selectedXcode); + } Object.keys(results.xcode).forEach(function (ver) { checkXcode(results.xcode[ver]);