diff --git a/lib/devices/ios/instruments.js b/lib/devices/ios/instruments.js index 97097547f08..31daa1a0402 100644 --- a/lib/devices/ios/instruments.js +++ b/lib/devices/ios/instruments.js @@ -239,15 +239,12 @@ Instruments.prototype.spawnInstruments = function(tmpDir) { args = args.concat(["-e", "UIARESULTSPATH", tmpDir]); var env = _.clone(process.env); var buildPath = path.resolve(__dirname, "../../../build"); - var iwdPath = path.resolve(buildPath, "iwd"); - var iwd4Path = path.resolve(buildPath, "iwd4"); + var isXcode4 = this.xcodeVersion !== null && this.xcodeVersion[0] === '4'; + var iwdPath = path.resolve(buildPath, isXcode4 ? "iwd4" : "iwd"); env.CA_DEBUG_TRANSACTIONS = 1; if (this.withoutDelay && !this.udid) { - var isXcode4 = this.xcodeVersion !== null && this.xcodeVersion[0] === '4'; - env.DYLD_INSERT_LIBRARIES = path.resolve(isXcode4 ? iwd4Path : iwdPath, - "InstrumentsShim.dylib"); - - env.LIB_PATH = path.resolve(__dirname, isXcode4 ? iwd4Path : iwdPath); + env.DYLD_INSERT_LIBRARIES = path.resolve(iwdPath, "InstrumentsShim.dylib"); + env.LIB_PATH = iwdPath; } logger.info("Spawning instruments with command: " + this.instrumentsPath + " " + args.join(" "));