title: Testing Failed when build using Xcode build command or appium
body: <p>I am using :</p>
  
  <pre><code>Xcode 10.1
  Os Version : 12.1
  iPhone 6
  </code></pre>
  
  <p>I did follow all required steps to setup build and everything but still getting error when try to build project using xcode build.</p>
  
  <p>I am confuse between 2 thing that is it signing issue or I am missing some config. in webdriver agent xproj.</p>
  
  <h2>Actual Error on xcode build command</h2>
  
  <pre><code>Testing failed:
  WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. (Underlying error: Unable to launch com.apple.test.WebDriverAgentRunner-Runner. (Underlying error: The operation couldn’t be completed. (DTXMessage error 1.))))
  </code></pre>
  
  <h2>Actual Error on appium</h2>
  
  <pre><code>Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
  </code></pre>
  
  <h2>Some other logs if that helps :</h2>
  
  <pre><code>2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}
  2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=IDETestOperationsObserverErrorDomain Code=4 “Failed to install or launch the test runner” UserInfo={NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/asianweb/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Test-WebDriverAgentRunner-2018.11.19_11-02-01-+0530.xcresult, NSLocalizedDescription=Failed to install or launch the test runner, NSUnderlyingError=0x7f8ec7ac6c70 {Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}}}
  </code></pre>
  
  <h2>Other logs info</h2>
  
  <pre><code>{
  deviceSerialNumber: XXXXXXXXXXXX
  identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
  deviceClass: iPhone
  deviceName: qa’s iPhone
  deviceIdentifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
  productVersion: 12.1
  buildVersion: 16B92
  deviceSoftwareVersion: 12.1 (16B92)
  deviceArchitecture: arm64
  deviceTotalCapacity: 11945508864
  deviceAvailableCapacity: 5477302272
  deviceIsTransient: NO
  ignored: NO
  deviceIsBusy: NO
  deviceIsPaired: YES
  deviceIsActivated: YES
  deviceActivationState: Activated
  isPasscodeLocked: NO
  deviceType: &lt;DVTDeviceType:0x8f7ec4d00ca0 Xcode.DeviceType.iPhone&gt;
  supportedDeviceFamilies: (
  1
  )
  applications: (null)
  provisioningProfiles: (null)
  hasInternalSupport: NO
  isSupportedOS: YES
  developerDiskMountError: (null)
  (null)
  bootArgs: (null)
  connected: yes
  isWirelessEnabled: no
  connectionType: direct
  hostname: (null)
  bonjourServiceName: 90:60:f1:6b:7f:91@fe80::9760:f1ff:fe6b:2f92._apple-mobdev2._tcp.local.
  } (12.1 (16B92))
  </code></pre>
  
  <p><strong>Note :</strong> While I run it, it puts my app and webdriveragent into iphone device and then stopped.</p>