mirror of
https://github.com/appium/appium.git
synced 2026-01-25 11:48:49 -06:00
don't hardcode xcode dir in getBuiltInAppDir (fix #1216)
This commit is contained in:
@@ -158,17 +158,21 @@ exports.checkPreferencesApp = function(version, cb) {
|
||||
};
|
||||
|
||||
exports.getBuiltInAppDir = function(version, cb) {
|
||||
var appDir = "/Applications/Xcode.app/Contents/Developer/Platforms" +
|
||||
"/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator" +
|
||||
version + ".sdk/Applications/";
|
||||
fs.stat(appDir, function(err, s) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else if (!s.isDirectory()) {
|
||||
cb("Could not load built in applications directory");
|
||||
} else {
|
||||
cb(null, appDir);
|
||||
}
|
||||
exports.getXcodeFolder(function(err, xcodeDir) {
|
||||
if (err) return cb(err);
|
||||
|
||||
var appDir = path.resolve(xcodeDir, "Platforms/iPhoneSimulator.platform/" +
|
||||
"Developer/SDKs/iPhoneSimulator" + version +
|
||||
".sdk/Applications/");
|
||||
fs.stat(appDir, function(err, s) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else if (!s.isDirectory()) {
|
||||
cb("Could not load built in applications directory");
|
||||
} else {
|
||||
cb(null, appDir);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user