Resolution to error

Hi all

I am getting below error while running the tests -

Appium - 1.6
MAc OS - 10.12.2

[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: ‘/usr/local/bin/carthage’
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[debug] [BaseDriver] Event ‘wdaStartFailed’ logged at 1496269790725 (15:29:50 GMT-0700 (PDT))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Cannot read property ‘on’ of undefined
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[debug] [XCUITest] Removing WDA application from device
[simctl] TypeError: Cannot read property ‘on’ of undefined
at …/…/lib/teen_process.js:38:15
at Promise.F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at exec (…/…/lib/teen_process.js:24:10)
at callee$1$0$ (…/…/lib/simctl.js:35:18)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)

Please help!