From 2085253133e52b3988818c55e22edcde1812f4e0 Mon Sep 17 00:00:00 2001 From: Erlend Halvorsen Date: Thu, 31 Jul 2014 16:11:57 +0200 Subject: [PATCH] If we have more than one iOS simulator directory then try filtering out any that doesn't have an Applications folder --- lib/devices/ios/ios-controller.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/devices/ios/ios-controller.js b/lib/devices/ios/ios-controller.js index d7e2bb5fa..8b0728dcc 100644 --- a/lib/devices/ios/ios-controller.js +++ b/lib/devices/ios/ios-controller.js @@ -472,6 +472,17 @@ iOSController._getFullPath = function (remotePath, cb) { logger.warn("There were multiple simulator roots for version " + v + ". " + "We may be pulling the file from the one you're not using!"); } + + if (simRoots.length > 1) { + var filteredSimRoots = simRoots.filter(function (root) { + return fs.existsSync(root + "/Applications"); + }); + + if (filteredSimRoots.length > 0) { + simRoots = filteredSimRoots; + } + } + var basePath = simRoots[0]; var appName = null;