From beafe491c42c6fc490a828a2b775e23d7472c171 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Thu, 2 Oct 2014 22:57:45 -0700 Subject: [PATCH] Warn if old iOS SDKs installed --- tools/commands-cordova.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index 630265aa5d..7d288f7810 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -1427,6 +1427,16 @@ _.extend(IOS.prototype, { var cmd = new processes.RunCommand('/usr/bin/open', [ '/Applications/Xcode.app/' ]); var execution = cmd.run(); + }, + + getDirectoryForSdk: function (version) { + return path.join('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/', version); + }, + + isSdkInstalled: function (version) { + var self = this; + var stat = files.statOrNull(self.getDirectoryForSdk(version)); + return stat != null; } }); @@ -1962,6 +1972,14 @@ main.registerCommand({ ios.launchXcode(); } } + + // XXX: Other versions + _.each(['iPhoneOS5.0.sdk', 'iPhoneOS6.0.sdk', 'iPhoneOS6.1.sdk'], function (version) { + if (ios.isSdkInstalled(version)) { + Console.warn("An old version of the iPhone SDK is installed (" + version + "); you should probably delete it"); + Console.info("You can delete it by deleting the directory: " + ios.getDirectoryForSdk(version)); + } + }); } }