Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25738] Fixed watch sim executable detection for Xcode 9+. Also… #74

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2014-2015 by Appcelerator, Inc.
Copyright 2014-2018 by Appcelerator, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,4 +41,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 changes: 10 additions & 2 deletions lib/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module simulator
*
* @copyright
* Copyright (c) 2014-2017 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2014-2018 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License.
Expand Down Expand Up @@ -1189,6 +1189,11 @@ function launch(simHandleOrUDID, options, callback) {
return next();
}

if (!handle.simulator) {
emitter.emit('log-debug', __('Cannot run simulator %s because executable was not found', handle.udid));
return next();
}

// not running, start the simulator
emitter.emit('log-debug', __('Running: %s', handle.simulator + ' -CurrentDeviceUDID ' + handle.udid));

Expand Down Expand Up @@ -1551,7 +1556,10 @@ function launch(simHandleOrUDID, options, callback) {

async.series([
function waitForWatchAppToSync(next) {
if (watchSimHandle && watchAppId && !simHandle.installed) {
// if we're installing a watch app, only wait for the app to install if we're running
// Xcode 8.x or older... Xcode 9's "simctl install" blocks until both the app and watch
// app are installed
if (watchSimHandle && watchAppId && !simHandle.installed && appc.version.lt(selectedXcode.version, '9.0')) {
// since we are launching the Watch Simulator, we need to give the iOS Simulator a
// second to install the watch app in the Watch Simulator
emitter.emit('log-debug', __('Waiting for Watch App to install...'));
Expand Down
12 changes: 8 additions & 4 deletions lib/xcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module xcode
*
* @copyright
* Copyright (c) 2014-2017 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2014-2018 by Appcelerator, Inc. All Rights Reserved.
*
* Copyright (c) 2010-2014 Digital Bazaar, Inc.
* {@link https://github.com/digitalbazaar/forge}
Expand Down Expand Up @@ -385,9 +385,13 @@ exports.detect = function detect(options, callback) {
}
});

var watchsim = path.join(dir, 'Applications', 'Simulator (Watch).app', 'Contents', 'MacOS', 'Simulator (Watch)');
if (fs.existsSync(watchsim)) {
xc.executables.watchsimulator = watchsim;
if (appc.version.gte(xc.version, 9)) {
xc.executables.watchsimulator = xc.executables.simulator;
} else {
var watchsim = path.join(dir, 'Applications', 'Simulator (Watch).app', 'Contents', 'MacOS', 'Simulator (Watch)');
if (fs.existsSync(watchsim)) {
xc.executables.watchsimulator = watchsim;
}
}

selected && (results.selectedXcode = xc);
Expand Down