Unable to get WebDriverAgent to work on a real device

I’m trying to get appium to work with iOS 10.0.2 and its been a frustrating ride for the last 48 hours.

I’m following tutorials and youtube videos to figure this thing out but for some reason when i open WebAgentDriver.proj, I’m seeing 2 warnings saying,

The file “ProjectSettings.xcconfig” couldn’t be opened because there is no such file. (/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig)

and this is the first time I’m opening the project. Thats like walking into a new house and finding a huge part of the floor missing for some reason. There are a couple of posts suggesting to make a new config file and add it as a capability. Thats where questions start popping up.

If I need webdriveragent for testing all the apps, then should I be adding this line to every test that I create? Is there any way I can fix this in xCode itself? Is there a way I can get this WebDriverAgent to run so I don’t have to include a workaround in all my tests?
I still don’t know if adding the config as capability is a workaround or a permanent fix.

Issue #2:
I made an app. Just an app with one field to see if I’m able to install apps through appium. I’m getting the following error.

ODEV1s-MacBook-Pro:WebDriverAgent odev1$ appium -U cd82456f42112bf4b3j4h235702bc7947a8b4a
[Appium] Welcome to Appium v1.6.3
[Appium] Non-default server args:
[Appium] udid: 'cd82456f42112bf345kj36lc7947a8b4a’
[Appium] Deprecated server args:
[Appium] -U,–udid => --default-capabilities '{“udid”:“cd82456f42112bf4b41724k5n34l647a8b4a”}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] udid: 'cd82456f42112bf4b445n34l62bc7947a8b4a’
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app",“appium-version”:“1.6.3”,“xcodeConfigfile”:"/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig",“platformVersion”:“10.0”,“automationName”:“XCUITest”,“platformName”:“iOS”,“deviceName”:“Phone with Touchscreen”,“UDID”:“cd82456f42112bf4b417613ed3702bc7947a8b4a”}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app",“appium-version”:“1.6.3”,“xcodeConfigfile”:"/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig",“platformVersion”:“10.0”,“automationName”:“XCUITest”,“platformName”:“iOS”,“deviceName”:“Phone with Touchscreen”,“UDID”:“cd82456f42112bf4b417613ed3702bc7947a8b4a”},null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’
[Appium] appium-version: '1.6.3’
[Appium] xcodeConfigfile: '/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig’
[Appium] platformVersion: '10.0’
[Appium] automationName: 'XCUITest’
[Appium] platformName: 'iOS’
[Appium] deviceName: 'Phone with Touchscreen’
[Appium] UDID: 'cd82456f42112bf4b41761kj425n4702bc7947a8b4a’
[Appium] udid: 'cd82456f42112bf4b41kj43tlk702bc7947a8b4a’
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] The following capabilities were provided, but are not recognized by appium: appium-version, xcodeConfigfile, UDID.
[BaseDriver] Session created with session id: 8389af56-e79a-47d8-8c37-86ea952a7198
[debug] [XCUITest] Xcode version set to '8.2.1’
[debug] [XCUITest] iOS SDK Version set to '10.2’
[debug] [XCUITest] Available devices: cd82456f42112bf4b41763456nl345kjc7947a8b4a, cd82456f42112bf4b417613ed3702bc7947a8b4a
[debug] [XCUITest] Creating iDevice object with udid cd82456f42112bf4b41761343tn34kc7947a8b4a
[XCUITest] Determining device to run tests on: udid: ‘cd82456f42112bf4b417634lk6346bc7947a8b4a’, real device: true
[BaseDriver] Using local app '/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app’
[debug] [XCUITest] Checking whether app ‘/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app’ is actually present
[debug] [XCUITest] App is present
[debug] [ios-app-utils] Getting bundle ID from app ‘/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app’: 'ADC.TestiOSDevice’
[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 already installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[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’
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger 'idevicesyslog’
[debug] [XCUITest] Beginning test with command ‘xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=cd82456f42112bf4b417613ed3702bc7947a8b4a -configuration Debug’ in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent’
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/odev1/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/342ECB42-B4F3-4C43-A977-072499308CF2/Session-WebDriverAgentRunner-2017-01-16_233727-1kGudn.log
[Xcode] 2017-01-16 23:37:27.638 xcodebuild[28737:669486] Error Domain=IDETestOperationsObserverErrorDomain Code=3 “Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/usjaxfsodev1/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/342ECB42-B4F3-4C43-A977-072499308CF2/Session-WebDriverAgentRunner-2017-01-16_233727-1kGudn.log” UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/usjaxfsodev1/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/342ECB42-B4F3-4C43-A977-072499308CF2/Session-WebDriverAgentRunner-2017-01-16_233727-1kGudn.log}

[Xcode] Code signing is required for product type ‘UI Testing Bundle’ in SDK 'iOS 10.2’

**[Xcode] **

[Xcode] **
Testing failed:
** Signing for “WebDriverAgentRunner” requires a development team. Select a development team in the project editor.

[Xcode] Code signing is required for product type ‘UI Testing Bundle’ in SDK 'iOS 10.2’
**** TEST FAILED ****

The following build commands failed:
** Check dependencies**
(1 failure)

[XCUITest] xcodebuild exited with code ‘65’ and signal 'null’
[debug] [XCUITest] xcodebuild failure warrants retry. Retrying…
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down Logger process (pid 28742)
[debug] [XCUITest] Logger process did not end in a timely fashion: ‘Process didn’t end after 10000ms’. Sending ‘SIGKILL’…
[XCUITest] System log exited with code 'null’
[debug] [XCUITest] Removing WDA application from device
[debug] [XCUITest] Error : Command ‘ios-deploy --uninstall_only --id cd82456f42112bf4bds87f6sdfed3702bc7947a8b4a --bundle_id com.apple.test.WebDriverAgentRunner-Runner’ exited with code null
[XCUITest] Error: Could not remove app Command ‘ios-deploy --uninstall_only --id cd82456f42112bf4b417613ed3702bc7947a8b4a --bundle_id com.apple.test.WebDriverAgentRunner-Runner’ exited with code null
** at IOSDeploy.remove$ (…/…/lib/ios-deploy.js:25:13)**
** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** at process._tickCallback (internal/process/next_tick.js:103:7)**
** Error: Could not remove app Command ‘ios-deploy --uninstall_only --id cd82456f42112bf4b417613ed3702bc7947a8b4a --bundle_id com.apple.test.WebDriverAgentRunner-Runner’ exited with code null**
** at IOSDeploy.remove$ (…/…/lib/ios-deploy.js:25:13)**
** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** at process._tickCallback (internal/process/next_tick.js:103:7)**
[XCUITest] Shutting down sub-processes
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Could not remove app Command ‘ios-deploy --uninstall_only --id cd82456f42112bf4b417613d8f6ds802bc7947a8b4a --bundle_id com.apple.test.WebDriverAgentRunner-Runner’ exited with code null
** at IOSDeploy.remove$ (…/…/lib/ios-deploy.js:25:13)**
** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** at process._tickCallback (internal/process/next_tick.js:103:7)**
[HTTP] <-- POST /wd/hub/session 500 67919 ms - 318 **
^C[Appium] Received SIGINT - shutting down
ODEV1s-MacBook-Pro:WebDriverAgent odev1$ appium -U cd82456f42112bf4b417613ed3702bc7947a8b4a
[Appium] Welcome to Appium v1.6.3
[Appium] Non-default server args:
[Appium] udid: 'cd82456f42112bf4b417613ed3702bc7947a8b4a’
[Appium] Deprecated server args:
[Appium] -U,–udid => --default-capabilities '{“udid”:“cd82456f42112bf4b417613ed3702bc7947a8b4a”}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] udid: 'cd82456f42112bf4bas8fd69a83ed3702bc7947a8b4a’
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app",“appium-version”:“1.6.3”,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“platformName”:“iOS”,“deviceName”:“Phone with Touchscreen”,“UDID”:“cd82456f42112df876d9df765dsf876dfed3702bc7947a8b4a”}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app",“appium-version”:“1.6.3”,“platformVersion”:“10.0”,“automationName”:“XCUITest”,“platformName”:“iOS”,“deviceName”:“Phone with Touchscreen”,“UDID”:“cd82456f42112bf4bdfs8ds6f83ed3702bc7947a8b4a”},null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’
[Appium] appium-version: '1.6.3’
[Appium] platformVersion: '10.0’
[Appium] automationName: 'XCUITest’
[Appium] platformName: 'iOS’
[Appium] deviceName: 'Phone with Touchscreen’
[Appium] UDID: 'cd82456f42112bf4b417613ed3702bc7947a8b4a’
[Appium] udid: 'cd82456f42112bf4b417613ed3702bc7947a8b4a’
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] The following capabilities were provided, but are not recognized by appium: appium-version, UDID.
[BaseDriver] Session created with session id: 60daaab5-587c-4e6a-b218-c0a27b92d04f
[debug] [XCUITest] Xcode version set to '8.2.1’
[debug] [XCUITest] iOS SDK Version set to '10.2’
[debug] [XCUITest] Available devices: cd82456f42112bf4b417613ed3702bc7947a8b4a, cd82456f42112bf4b417613ed3702bc7947a8b4a
[debug] [XCUITest] Creating iDevice object with udid cd82456f42112bf4b417613ed3702bc7947a8b4a
[XCUITest] Determining device to run tests on: udid: ‘cd82456f42112bf4b417613ed3702bc7947a8b4a’, real device: true
[BaseDriver] Using local app '/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’
[debug] [XCUITest] Checking whether app ‘/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app’ is actually present
[debug] [XCUITest] App is present
[debug] [ios-app-utils] Getting bundle ID from app ‘/Users/usjaxfsodev1/Desktop/Test Apps/TestiOSDevice IOS100.app’: 'ADC.TestiOSDevice’
[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] Error checking install status: Command ‘ios-deploy --exists --id cd82456f42112bf4b417613ed3702bc7947a8b4a --bundle_id ADC.TestiOSDevice’ exited with code null
[debug] [XCUITest] App is not installed. Will try to install.
[debug] [XCUITest] Error : Command ‘ios-deploy --id cd82456f42112bf4b417613ed3702bc7947a8b4a --uninstall --bundle ‘/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’’ exited with code null
[XCUITest] Error: Could not install app Command ‘ios-deploy --id cd82456f42112bf4b417613ed3702bc7947a8b4a --uninstall --bundle ‘/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’’ exited with code null
** at IOSDeploy.install$ (…/…/lib/ios-deploy.js:39:13)

** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** Error: Could not install app Command ‘ios-deploy --id cd82456f42112bf4b417613ed3702bc7947a8b4a --uninstall --bundle ‘/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’’ exited with code null**
** at IOSDeploy.install$ (…/…/lib/ios-deploy.js:39:13)**
** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Could not install app Command ‘ios-deploy --id cd82456f42112bf4b417613ed3702bc7947a8b4a --uninstall --bundle ‘/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app’’ exited with code null
** at IOSDeploy.install$ (…/…/lib/ios-deploy.js:39:13)**
** 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)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
[HTTP] <-- POST /wd/hub/session 500 109327 ms - 333

This is the code I’m using in my Java file that is causing the error mentioned above.

import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.AppiumDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.net.MalformedURLException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
import org.openqa.selenium.By;

public class ios10 {
public static void main(String[] args) {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“appium-version”, “1.6.3”);
//capabilities.setCapability(“xcodeConfigfile”, “/usr/local/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig”);
//capabilities.setCapability(“bundleId”,“ADC.TestiOSDevice”);
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “10.0”);
capabilities.setCapability(“deviceName”, “Phone with Touchscreen”);
capabilities.setCapability(“UDID”, “cd82456f42112bfj32b545jk54702bc7947a8b4a”);
//capabilities.setCapability(“app”, “/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app”);
capabilities.setCapability(“app”, “/Users/odev1/Desktop/Test Apps/TestiOSDevice IOS100.app”);
AppiumDriver wd;
try {
wd = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
wd.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIASwitch[1]")).click();
String lblValue=wd.findElement(By.name(“Mobile Automation - Sup?!”)).getAttribute(“value”);
System.out.print(lblValue);
wd.close();
} catch (MalformedURLException e) {
e.printStackTrace();
}

Any attempts to help me get past these frustrating errors would be greatly appreciated.

please install ios-depoly using brew.