Can't launch iOS app on real device using the Appium 1.6.4 beta

Platform: iOS
Appium version: 1.6.4Beta
iPhone 10.2.1
Language: Java
Java Client: 5.0.0 Beta
OS: macOS Sierra 10.12.2

==========================
When attempting to run our code on iPhone, the app is installed but Fails to launch.

This is the error in the log:
Unable to launch WebDriverAgent because of xcodebuild failure: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1

This is the capabilities we use:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,genMeth.getValueFromPropFile(“deviceName”));
capabilities.setCapability(MobileCapabilityType.UDID, genMeth.getValueFromPropFile(“udid”));
capabilities.setCapability(“app”,genMeth.getValueFromPropFile(“appPath”));
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“xcodeOrgId”, “7Y5J2RJXYV”);
capabilities.setCapability(“xcodeSigningId”, “iPhone Developer”);
capabilities.setCapability(“useNewWDA”, “true”);
capabilities.setCapability(“wdaLaunchTimeout”, 10000);
capabilities.setCapability(“updatedWDABundleId”, genMeth.getValueFromPropFile(“appIdentifier”));
capabilities.setCapability(“wdaConnectionTimeout”, 10000);

try {

	driver = new IOSDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);

ENV:
MacOS Sierra 10.12.2
iPhone --> . 10.2.1
Appium–> 1.6.4 Beta

This is the full Log:
Last login: Wed Feb 1 23:10:42 on ttys000
Menys-MacBook-Pro:~ menypeled$ appium -g
usage: appium [-h] [-v] [–shell] [–reboot] [–ipa IPA] [-a ADDRESS]
[-p PORT] [-ca CALLBACKADDRESS] [-cp CALLBACKPORT]
[-bp BOOTSTRAPPORT] [-r BACKENDRETRIES] [–session-override]
[-l] [-g LOG]
[–log-level {info,info:debug,info:info,info:warn,info:error,warn,warn:debug,warn:info,warn:warn,warn:error,error,error:debug,error:info,error:warn,error:error,debug,debug:debug,debug:info,debug:warn,debug:error}]
[–log-timestamp] [–local-timezone] [–log-no-colors]
[-G WEBHOOK] [–safari] [–default-device] [–force-iphone]
[–force-ipad] [–tracetemplate AUTOMATIONTRACETEMPLATEPATH]
[–instruments INSTRUMENTSPATH] [–nodeconfig NODECONFIG]
[-ra ROBOTADDRESS] [-rp ROBOTPORT]
[–selendroid-port SELENDROIDPORT]
[–chromedriver-port CHROMEDRIVERPORT]
[–chromedriver-executable CHROMEDRIVEREXECUTABLE]
[–show-config] [–no-perms-check] [–strict-caps]
[–isolate-sim-device] [–tmp TMPDIR] [–trace-dir TRACEDIR]
[–debug-log-spacing] [–suppress-adb-kill-server]
[–async-trace] [–webkit-debug-proxy-port WEBKITDEBUGPROXYPORT]
[–webdriveragent-port WDALOCALPORT] [-dc DEFAULTCAPABILITIES]
[–command-timeout DEFAULTCOMMANDTIMEOUT] [-k]
[–platform-name PLATFORMNAME]
[–platform-version PLATFORMVERSION]
[–automation-name AUTOMATIONNAME] [–device-name DEVICENAME]
[–browser-name BROWSERNAME] [–app APP] [-lt LAUNCHTIMEOUT]
[–language LANGUAGE] [–locale LOCALE] [-U UDID]
[–orientation ORIENTATION] [–no-reset] [–full-reset]
[–app-pkg APPPACKAGE] [–app-activity APPACTIVITY]
[–app-wait-package APPWAITPACKAGE]
[–app-wait-activity APPWAITACTIVITY]
[–device-ready-timeout DEVICEREADYTIMEOUT]
[–android-coverage ANDROIDCOVERAGE] [–avd AVD]
[–avd-args AVDARGS] [–use-keystore]
[–keystore-path KEYSTOREPATH]
[–keystore-password KEYSTOREPASSWORD] [–key-alias KEYALIAS]
[–key-password KEYPASSWORD] [–intent-action INTENTACTION]
[–intent-category INTENTCATEGORY] [–intent-flags INTENTFLAGS]
[–intent-args OPTIONALINTENTARGUMENTS]
[–dont-stop-app-on-reset] [–calendar-format CALENDARFORMAT]
[–native-instruments-lib] [–keep-keychains]
[–localizable-strings-dir LOCALIZABLESTRINGSDIR]
[–show-ios-log]

appium: error: argument “-g/–log”: Expected one argument. null
Menys-MacBook-Pro:~ menypeled$ npm install wd

[email protected] install /Users/menypeled/node_modules/wd
node scripts/build-browser-scripts
/Users/menypeled
└─┬ [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open ‘/Users/menypeled/package.json’
npm WARN menypeled No description
npm WARN menypeled No repository field.
npm WARN menypeled No README data
npm WARN menypeled No license field.
Menys-MacBook-Pro:~ menypeled$ npm install wd

[email protected] install /Users/menypeled/node_modules/wd
node scripts/build-browser-scripts
/Users/menypeled
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open ‘/Users/menypeled/package.json’
npm WARN menypeled No description
npm WARN menypeled No repository field.
npm WARN menypeled No README data
npm WARN menypeled No license field.
Menys-MacBook-Pro:~ menypeled$ appium &
[1] 3179
Menys-MacBook-Pro:~ menypeled$ [Appium] Welcome to Appium v1.6.4-beta
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
Menys-MacBook-Pro:~ menypeled$ clear

Menys-MacBook-Pro:~ menypeled$ [HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app",“wdaLaunchTimeout”:10000,“xcodeOrgId”:“7Y5J2RJXYV”,“automationName”:“XCUITest”,“useNewWDA”:“true”,“udid”:“51d8c712258a5b0ac63516aa5be9d10014b0c270”,“platformName”:“iOS”,“deviceName”:“SG iPhone 5s”,“updatedWDABundleId”:“beta.SkyGiraffe.SkyGiraffe”,“wdaConnectionTimeout”:10000,“xcodeSigningId”:“iPhone Developer”}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app",“wdaLaunchTimeout”:10000,“xcodeOrgId”:“7Y5J2RJXYV”,“automationName”:“XCUITest”,“useNewWDA”:“true”,“udid”:“51d8c712258a5b0ac63516aa5be9d10014b0c270”,“platformName”:“iOS”,“deviceName”:“SG iPhone 5s”,“updatedWDABundleId”:“beta.SkyGiraffe.SkyGiraffe”,“wdaConnectionTimeout”:10000,“xcodeSigningId”:“iPhone Developer”},null,null,null,null]
[Appium] Creating new XCUITestDriver (v2.6.0) session
[Appium] Capabilities:
[Appium] app: ‘/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app’
[Appium] wdaLaunchTimeout: 10000
[Appium] xcodeOrgId: ‘7Y5J2RJXYV’
[Appium] automationName: ‘XCUITest’
[Appium] useNewWDA: ‘true’
[Appium] udid: ‘51d8c712258a5b0ac63516aa5be9d10014b0c270’
[Appium] platformName: ‘iOS’
[Appium] deviceName: ‘SG iPhone 5s’
[Appium] updatedWDABundleId: ‘beta.SkyGiraffe.SkyGiraffe’
[Appium] wdaConnectionTimeout: 10000
[Appium] xcodeSigningId: ‘iPhone Developer’
[debug] [XCUITest] XCUITestDriver version: 2.6.0
[BaseDriver] Capability ‘useNewWDA’ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: 7039285c-2996-4408-8593-b70cb47cfd26
[debug] [XCUITest] Xcode version set to ‘8.2.1’
[debug] [XCUITest] iOS SDK Version set to ‘10.2’
[debug] [XCUITest] Available devices: 51d8c712258a5b0ac63516aa5be9d10014b0c270
[debug] [XCUITest] Creating iDevice object with udid 51d8c712258a5b0ac63516aa5be9d10014b0c270
[XCUITest] Determining device to run tests on: udid: ‘51d8c712258a5b0ac63516aa5be9d10014b0c270’, real device: true
[BaseDriver] Using local app ‘/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app’
[debug] [XCUITest] Checking whether app ‘/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app’ is actually present on file system
[debug] [XCUITest] App is present
[debug] [iOS] Getting bundle ID from app ‘/Users/menypeled/Documents/workspace/iOS_Appium/SkyGiraffe.app’: ‘beta.SkyGiraffe.SkyGiraffe’
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: ‘/usr/local/bin/idevicesyslog’
[XCUITest] Setting up real device
[debug] [XCUITest] App is not installed. Will try to install.
[debug] [XCUITest] App installed successfully.
[XCUITest] Using WDA path: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Using WDA agent: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’
[debug] [XCUITest] Capability ‘useNewWDA’ set, so uninstalling WDA before proceeding
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: ‘/usr/local/bin/carthage’
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[debug] [XCUITest] Error resetting project file: ENOENT: no such file or directory, unlink ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj.old’
[XCUITest] Unable to reset project file ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj’ with bundle id ‘com.facebook.WebDriverAgentRunner’. WebDriverAgent has been modified and not returned to the original state.
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Using WDA path: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Using WDA agent: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’
[debug] [XCUITest] Capability ‘useNewWDA’ set, so uninstalling WDA before proceeding
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: ‘/usr/local/bin/carthage’
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[debug] [XCUITest] Error resetting project file: ENOENT: no such file or directory, unlink ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj.old’
[XCUITest] Unable to reset project file ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj’ with bundle id ‘com.facebook.WebDriverAgentRunner’. WebDriverAgent has been modified and not returned to the original state.
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Using WDA path: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Using WDA agent: ‘/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj’
[debug] [XCUITest] Capability ‘useNewWDA’ set, so uninstalling WDA before proceeding
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: ‘/usr/local/bin/carthage’
[debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
[XCUITest] Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:70:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close as _onclose
{ Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:70:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close as _onclose
stdout: ‘\u001b[1mFetching dependencies\n’,
stderr: ‘Error: Command “bootstrap” does not exist.\n’,
code: 1 }
[debug] [XCUITest] Running ios real device reset flow
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:70:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close as _onclose
[HTTP] <-- POST /wd/hub/session 500 13643 ms - 199

@menypeled please open issue in appium github repo with all the necessary details per bug templete