Appium: getting error Unable to launch WebDriverAgent because of xcodebuild failure: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1

Created on 18 Jan 2017  Â·  63Comments  Â·  Source: appium/appium

getting error Unable to launch WebDriverAgent because of xcodebuild failure: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1

Appium version (or git revision) that exhibits the issue: 1.6.1-beta
Last Appium version that did not exhibit the issue (if applicable): NA
Desktop OS/version used to run Appium: 10.11.5
Node.js version (unless using Appium.app|exe): NA
Mobile platform/version under test: Iphone 4 - 9.3.5
Real device or emulator/simulator: Real Device
Appium CLI or Appium.app|exe: Appium CLI

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability("platformName", "iOS");
capabilities.SetCapability("automationName", "XCUITest");
capabilities.SetCapability("platformVersion", "9.3");
capabilities.SetCapability("platform", "Mac");
capabilities.SetCapability("deviceName", "Company’s iPhone");
capabilities.SetCapability("udid", "d82e4e89744ed0b1bc8976868a912184069978b7");
capabilities.SetCapability("bundleId", "ios-appium.MohitIOS");
capabilities.SetCapability("app", "/Users/testing/Desktop/MohitIOS.app");
capabilities.SetCapability("fullReset", true);
//Connecting to Appium Server
driver = new RemoteWebDriver(new Uri("http://10.140.1.80:4723/wd/hub"), capabilities);

Most helpful comment

@prateekchawla Xcodebuild code 65 means (at least in my experience) that your signing and provisioning profiles are incorrectly configured.

You need to open the xcode project located where you installed appium-xcuitest-driver, configure Xcode and the project to use signing keys and provisioning profiles that allow you to run these apps on the phone in question.

Without wildcard (or inclusive of appium) certificates, and provisioning profiles including the phone in question, you will not be able to use Appium with real iOS devices.

All 63 comments

Without the logs asked for it is not easy to say.

Do you have Carthage installed?

Appium Logs:

[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   platformName: 'iOS'
[Appium]   automationName: 'XCUITest'
[Appium]   platformVersion: '9.3'
[Appium]   platform: 'Mac'
[Appium]   deviceName: 'Company’s iPhone'
[Appium]   udid: 'd82e4e89744ed0b1bc8976868a912184069978b7'
[Appium]   bundleId: 'ios-appium.MohitIOS'
[Appium]   app: '/Users/testing/Desktop/MohitIOS.app'
[Appium]   fullReset: true
[debug] [XCUITest] XCUITestDriver version: 2.5.3
[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.
[BaseDriver] Session created with session id: e07054c4-49c9-4e81-af43-ccf408077964
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: d82e4e89744ed0b1bc8976868a912184069978b7
[debug] [XCUITest] Creating iDevice object with udid d82e4e89744ed0b1bc8976868a912184069978b7
[XCUITest] Determining device to run tests on: udid: 'd82e4e89744ed0b1bc8976868a912184069978b7', real device: true
[BaseDriver] Using local app '/Users/testing/Desktop/MohitIOS.app'
[debug] [XCUITest] Checking whether app '/Users/testing/Desktop/MohitIOS.app' is actually present
[debug] [XCUITest] App is present
[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 requested. Forcing app install after uninstall app
[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'
[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] 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'
[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

sorry, just attached the logs.
Carthage is installed according to the logs

Can you try running the following:

cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
/bin/bash Scripts/bootstrap.sh -d

Getting this

Failed to write to /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Carthage/Build/iOS: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “iOS” in the folder “Build”." UserInfo={NSFilePath=/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Carthage/Build/iOS, NSUnderlyingError=0x7fec29c7a190 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

looks like I need to give write permissions to this folder but i am not able to navigate to this path

Did you install with sudo or something?

Anyway, you ought to be able to use sudo now to change the permissions on that tree.

I did that with sudo

Looks like i need to change write permissions to that root folder.
any clue how can i navigate there ?

Thanks :)

I would just do:

chown -R $(whoami): /usr/local/lib/node_modules

No reason your global node modules should not be owned by your user.

Obviously this isn't a good idea if you are on a multi-user system.

I am getting the following error
Could not proxy command to remote server. Original error: Error: socket hang up
after
chown -R $(whoami): /usr/local/lib/node_modules

Well, at least that's a different error. We'll need the full appium logs for this new error.

(also, you may have needed to run that last command with sudo)

[debug] [XCUITest] XCUITestDriver version: 2.5.3
[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.
[BaseDriver] Session created with session id: 4935d1e1-fbb1-4a03-a014-afc3f9ce1e14
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: d82e4e89744ed0b1bc8976868a912184069978b7
[debug] [XCUITest] Creating iDevice object with udid d82e4e89744ed0b1bc8976868a912184069978b7
[XCUITest] Determining device to run tests on: udid: 'd82e4e89744ed0b1bc8976868a912184069978b7', real device: true
[BaseDriver] Using local app '/Users/testing/Desktop/MohitIOS.app'
[debug] [XCUITest] Checking whether app '/Users/testing/Desktop/MohitIOS.app' is actually present
[debug] [XCUITest] App is present
[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 requested. Forcing app install after uninstall app
[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'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/E024FB4B-B428-4DF7-8431-BD6E1C80DD66/Session-WebDriverAgentRunner-2017-01-18_231722-slo84g.log
[Xcode] 2017-01-18 23:17:22.474 xcodebuild[5192:953123] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7f9fa68224f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

[Xcode] 2017-01-18 23:17:22.474 xcodebuild[5192:953123] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[Xcode] TEST EXECUTE FAILED

[XCUITest] xcodebuild exited with code '65' and signal 'null'
[XCUITest] Error: xcodebuild failed with code 65
at SubProcess. (../../lib/webdriveragent.js:246:25)
at emitTwo (events.js:87:13)
at SubProcess.emit (events.js:172:7)
at ChildProcess. (../../lib/teen_process.js:205:14)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
[Error: xcodebuild failed with code 65]
[debug] [JSONWP Proxy] Proxying [DELETE /session/4935d1e1-fbb1-4a03-a014-afc3f9ce1e14] to [DELETE http://localhost:8100/session/4935d1e1-fbb1-4a03-a014-afc3f9ce1e14] with no body
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: socket hang up
at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:127: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 run (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:108:47)
at /usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:119:28
at flush (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.microtask.js:19:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
[HTTP] <-- POST /wd/hub/session 500 35547 ms - 216
[debug] [XCUITest] WebDriverAgent successfully started after 2393ms

And if you go back and run the commands @imurchie posted?

It gives fetching dependencies and shows up nothing after that

i think that means it worked. let's try something else. make sure you are _not_ using sudo, then:

npm uninstall -g appium
npm install -g appium

to make sure all old stuff is cleared out. then try your test again.

Thanks , I will try this tomorrow and let you know with the results.

many thanks @jlipps and many thanks @imurchie :+1:

Good Morning !
I tried by uninstalling and installing appium

here is the appium logs

> [19:07:03] Prateek Chawla: [XCUITest] xcodebuild exited with code '65' and signal 'null'
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 7869)
[debug] [XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Removing WDA application from device
[debug] [XCUITest] WebDriverAgent successfully started after 2417ms
[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] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/8DF92678-0B13-4503-ACEF-5FE37D01868C/Session-WebDriverAgentRunner-2017-01-19_190503-cBwdNZ.log
[Xcode] 2017-01-19 19:05:03.062 xcodebuild[7902:1187581] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7f8704cbbec0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

[Xcode] 2017-01-19 19:05:03.062 xcodebuild[7902:1187581] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

[Xcode]  TEST EXECUTE FAILED 


[XCUITest] xcodebuild exited with code '65' and signal 'null'
[XCUITest] Error: xcodebuild failed with code 65
    at SubProcess.<anonymous> (../../lib/webdriveragent.js:246:25)
    at emitTwo (events.js:87:13)
    at SubProcess.emit (events.js:172:7)
    at ChildProcess.<anonymous> (../../lib/teen_process.js:205:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
 [Error: xcodebuild failed with code 65]
[debug] [JSONWP Proxy] Proxying [DELETE /session/e6fdf334-7135-4625-b296-a335f5e67c5e] to [DELETE http://localhost:8100/session/e6fdf334-7135-4625-b296-a335f5e67c5e] with no body
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: socket hang up
    at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:127: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 run (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:108:47)
    at /usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:119:28
    at flush (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.microtask.js:19:5)
    at nextTickCallbackWith0Args (node.js:419:9)
    at process._tickCallback (node.js:348:13)
[HTTP] <-- POST /wd/hub/session 500 25430 ms - 216 
[debug] [XCUITest] WebDriverAgent successfully started after 2441ms
[19:07:49] Prateek Chawla: [Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   platformName: 'iOS'
[Appium]   automationName: 'XCUITest'
[Appium]   platformVersion: '9.3.5'
[Appium]   platform: 'Mac'
[Appium]   deviceName: 'Company’s iPhone'
[Appium]   udid: 'd82e4e89744ed0b1bc8976868a912184069978b7'
[Appium]   bundleId: 'ios-appium.MohitIOS'
[Appium]   app: '/Users/testing/Desktop/MohitIOS.app'
[Appium]   fullReset: false
[debug] [XCUITest] XCUITestDriver version: 2.5.3
[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.
[BaseDriver] Session created with session id: e6fdf334-7135-4625-b296-a335f5e67c5e
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: d82e4e89744ed0b1bc8976868a912184069978b7
[debug] [XCUITest] Creating iDevice object with udid d82e4e89744ed0b1bc8976868a912184069978b7
[XCUITest] Determining device to run tests on: udid: 'd82e4e89744ed0b1bc8976868a912184069978b7', real device: true
[BaseDriver] Using local app '/Users/testing/Desktop/MohitIOS.app'
[debug] [XCUITest] Checking whether app '/Users/testing/Desktop/MohitIOS.app' is actually present
[debug] [XCUITest] App is present
[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] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/BECA2D74-A064-40F5-9082-68C428DE538C/Session-WebDriverAgentRunner-2017-01-19_190446-d5HotY.log
[Xcode] 2017-01-19 19:04:46.396 xcodebuild[7841:1187362] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7fea867dbdf0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

[Xcode] 2017-01-19 19:04:46.396 xcodebuild[7841:1187362] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

[Xcode]  TEST EXECUTE FAILED 


[XCUITest] xcodebuild exited with code '65' and signal 'null'
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 7840)
[debug] [XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Removing WDA application from device
[debug] [XCUITest] WebDriverAgent successfully started after 2423ms
[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] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/BC158061-C01B-45FC-865F-5F5A9407E643/Session-WebDriverAgentRunner-2017-01-19_190454-JTYjC6.log
[Xcode] 2017-01-19 19:04:54.694 xcodebuild[7873:1187504] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7fe343c898c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

[Xcode] 2017-01-19 19:04:54.694 xcodebuild[7873:1187504] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

[Xcode]  TEST EXECUTE FAILED

@prateekchawla Xcodebuild code 65 means (at least in my experience) that your signing and provisioning profiles are incorrectly configured.

You need to open the xcode project located where you installed appium-xcuitest-driver, configure Xcode and the project to use signing keys and provisioning profiles that allow you to run these apps on the phone in question.

Without wildcard (or inclusive of appium) certificates, and provisioning profiles including the phone in question, you will not be able to use Appium with real iOS devices.

@prateekchawla https://github.com/appium/appium/issues/6867#issuecomment-273795275

try this out and let me know if it helps you as well

I am trying the solutions mentioned and will keep you updated.
Thankks

Can you also try deleting the directory /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy?

[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/2DA92E47-9C54-47F7-9293-054A2C0CEAB4/Session-WebDriverAgentRunner-2017-01-24_223025-QZjcI5.log
[Xcode] 2017-01-24 22:30:25.266 xcodebuild[3663:1277921] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7fc54aaf7cc0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

I tried running the Xocde project under appium>node_modules>appium-xcuitest-driver-WebDriverAgent
and was not able to build it even after signing it to the development team

That error usually means something is wrong with the signing, and it cannot be built. What happens when you load it in Xcode?

After installing Installed npm install app-inspector -g
It is installed under "/usr/local/lib/node_modules/app-inspector/node_modules/" and when i navigate to this path via terminal, it says not found.
Is there any other way to navigate to this path as i cant find it manually.

@imurchie one of the error i am getting is
The file “ProjectSettings.xcconfig” couldn’t be opened because there is no such file. (/Users/testing/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig)

Is that file there? It ought to be.

including this error as well
"routingHTTPServer/RoutingHTTPServer.h" file not found

that file isn't there when i check
(/Users/testing/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig

Somewhere along the way you must have deleted some things by mistake. I would re-install.

how can we uninstall and install
appium-xcuittest-driver>WebDriverAgent

or i shall re-install appium again ?

You _can_ re-install just the appium-xcuitest-driver.

cd /Users/testing/appium
npm uninstall appium-xcuitest-driver
npm install appium-xcuitest-driver

Alternatively you can go into /Users/testing/appium/node_modules/appium-xcuitest-driver and run git submodule update --init.

So i did re install xcuitest-driver and built it using terminal after code signing with my development profile.
I am getting the below logs

[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] platformName: 'iOS'
[Appium] automationName: 'XCUITest'
[Appium] platformVersion: '9.3.5'
[Appium] platform: 'Mac'
[Appium] deviceName: 'Company’s iPhone'
[Appium] udid: 'd82e4e89744ed0b1bc8976868a912184069978b7'
[Appium] bundleId: 'com.facebook.WebDriverAgentLib'
[Appium] newCommandTimeout: 180
[debug] [XCUITest] XCUITestDriver version: 2.5.3
[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.
[BaseDriver] Session created with session id: e0d64638-2767-4561-be44-1df77d6aa6a7
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: d82e4e89744ed0b1bc8976868a912184069978b7
[debug] [XCUITest] Creating iDevice object with udid d82e4e89744ed0b1bc8976868a912184069978b7
[XCUITest] Determining device to run tests on: udid: 'd82e4e89744ed0b1bc8976868a912184069978b7', real device: true
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real 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'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/83EB0EB1-0C80-4206-B607-07BEC7099B88/Session-WebDriverAgentRunner-2017-01-25_225713-V4tsiY.log
[debug] [XCUITest] WebDriverAgent successfully started after 16767ms
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.facebook.WebDriverAgentLib","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}
[HTTP] <-- POST /wd/hub/session - - ms - -

This is after i execute from the appium capabilities using bundle id for Webdriveragent.
It does open something on my ios device but then it gives the following error "http://10.140.1.80:4723/wd/hub/session timed out after 60 seconds" and the above logs

@prateekchawla What operation were you trying to perform? Some operations are no longer supported in XCUITest (I dealt with that), like driver.back() (Python syntax).

Similarly, try to avoid using XPath selectors.

okay now i am able to launch Integration app(which is under webdriver agent) through appium.
How can i navigate to a URL now from that app?

@prateekchawla if you want to navigate to a URL, why aren't you automating Safari?

you mean the Safari Launcher app ?

no, Safari itself. With capabilities like the following:

{
  "browserName": "Safari",
  "platformName": "iOS",
  "platformVersion": "9.3.5",
  "deviceName": "iPhone",
  "udid": "..."
}

This should be all you need to do to get a web session. From your logs it looked like you were trying to automate WebDriverAgentLib. This is not your app. WDA lib is something Appium installs internally to help the automation -- it's not something you automate intentionally yourself.

Thanks , would automating Safari needs some extra things to be configured or any Xcode project link to it ?

The HTTP request to the remote WebDriver server for URL http://10.140.1.80:4723/wd/hub/session timed out after 180 seconds.

I increased the Time span for web driver although i am getting the above error in many instances
driver = new RemoteWebDriver(new Uri("http://10.140.1.80:4723/wd/hub"), capabilities, TimeSpan.FromMinutes(3));

Can you relate this to something?

At this point what you are trying to do is no longer clear. Can you provide the full logs from the latest Appium run? As a gist.

I have an xcode project - SafariLauncherApp which signed in with my apple developer id

[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","automationName":"XCUITest","platformVersion":"9.3.5","platform":"Mac","deviceName":"Company’s iPhone","udid":"d82e4e89744ed0b1bc8976868a912184069978b7","bundleId":"com.AutomationDec","newCommandTimeout":240,"app":"/Users/testing/Desktop/SafariLauncher.app"},null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   platformName: 'iOS'
[Appium]   automationName: 'XCUITest'
[Appium]   platformVersion: '9.3.5'
[Appium]   platform: 'Mac'
[Appium]   deviceName: 'Company’s iPhone'
[Appium]   udid: 'd82e4e89744ed0b1bc8976868a912184069978b7'
[Appium]   bundleId: 'com.AutomationDec'
[Appium]   newCommandTimeout: 240
[Appium]   app: '/Users/testing/Desktop/SafariLauncher.app'
[debug] [XCUITest] XCUITestDriver version: 2.5.3
[BaseDriver] The following capabilities were provided, but are not recognized by appium: platform.
[BaseDriver] Session created with session id: 4c2d095a-3ada-4faa-b1a3-084acc0eef5d
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: d82e4e89744ed0b1bc8976868a912184069978b7
[debug] [XCUITest] Creating iDevice object with udid d82e4e89744ed0b1bc8976868a912184069978b7
[XCUITest] Determining device to run tests on: udid: 'd82e4e89744ed0b1bc8976868a912184069978b7', real device: true
[BaseDriver] Using local app '/Users/testing/Desktop/SafariLauncher.app'
[debug] [XCUITest] Checking whether app '/Users/testing/Desktop/SafariLauncher.app' is actually present
[debug] [XCUITest] App is present
[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] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=d82e4e89744ed0b1bc8976868a912184069978b7 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/testing/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/6113D5F2-2A6E-4507-9021-31D5C9A9D1C0/Session-WebDriverAgentRunner-2017-01-27_225655-NvvJBQ.log
[Xcode] 2017-01-27 22:57:07.426 xcodebuild[6696:1286600]  DTDeviceKit: Could not start house arrest service for app identifier com.apple.test.WebDriverAgentRunner-Runner [Error Domain=com.apple.dtdevicekit Code=-402653093 "Too many instances of this service are already running." UserInfo={NSLocalizedFailureReason=Too many instances of this service are already running., com.apple.dtdevicekit.stacktrace=(
 0   DTDeviceKitBase                     0x0000000117caf37b DTDKCreateNSError + 113
 1   DTDeviceKitBase                     0x0000000117cafab9 DTDK_AMDErrorToNSError + 791
 2   DTDeviceKitBase                     0x0000000117cc12a5 __70-[DTDKRemoteDeviceConnection startHouseArrestServiceForAppIdentifier:]_block_invoke + 100
 3   DTDeviceKitBase                     0x0000000117cc0181 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_4 + 22
 4   DTDeviceKitBase                     0x0000000117cb22c7 __DTDKExecuteInSession_block_invoke + 38
 5   DTDeviceKitBase                     0x0000000117cb18f0 __DTDKExecuteWithConnection_block_invoke_2 + 477
 6   DTDeviceKitBase                     0x0000000117cb16ec __DTDKExecuteWithConnection_block_invoke + 107
 7   libdispatch.dylib                   0x00007fff9e09040b _dispatch_client_callout + 8
 8   libdispatch.dylib                   0x00007fff9e09ea9a _dispatch_barrier_sync_f_slow + 856
 9   DVTFoundation                       0x000000010ee1795b DVTDispatchBarrierSync + 206
 10  DVTFoundation                       0x000000010edf4307 -[DVTDispatchLock performLockedBlock:] + 116
 11  DTDeviceKitBase                     0x0000000117cb15f6 DTDKExecuteWithConnection + 223
 12  DTDeviceKitBase                     0x0000000117cb2251 DTDKExecuteInSession + 121
 13  DTDeviceKitBase                     0x0000000117cc00b8 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 117
 14  DVTFoundation                       0x000000010ee16cb7 __DVTDispatchAsync_block_invoke + 827
 15  libdispatch.dylib                   0x00007fff9e09b93d _dispatch_call_block_and_release + 12
 16  libdispatch.dylib                   0x00007fff9e09040b _dispatch_client_callout + 8
 17  libdispatch.dylib                   0x00007fff9e0a2bd7 _dispatch_async_redirect_invoke + 1733
 18  libdispatch.dylib                   0x00007fff9e09040b _dispatch_client_callout + 8
 19  libdispatch.dylib                   0x00007fff9e09429b _dispatch_root_queue_drain + 1890
 20  libdispatch.dylib                   0x00007fff9e093b00 _dispatch_worker_thread3 + 91
 21  libsystem_pthread.dylib             0x00007fff8f7514de _pthread_wqthread + 1129
 22  libsystem_pthread.dylib             0x00007fff8f74f341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Too many instances of this service are already running., NSLocalizedDescription=Too many instances of this service are already running.}]

[debug] [XCUITest] WebDriverAgent successfully started after 23541ms
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.AutomationDec","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}

This launches my WebDriver agent but times out while opening the SafariLauncher app

Same issue we also faced.. can you please help on same.......

@prateekchawla I'll say it again that if your purpose is to automate Safari, you should _not_ be targeting SafariLauncher. That is something internal to Appium.

Thanks @imurchie @jlipps @emil-petersen @vikramvi
I was able to resolve the issue, it was more related to code-signing and using web driver runner agent.

Hence closing the issue.

@prateekchawla How did you fix it ? Please help I have this error when running a simulator on Xcode .

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

How can it be fixed?

try #6867 (comment)

@prateekchawla what comment exactly did you mean from #6967?

@SibaMvelo @cbalea

follow the below link:
https://discuss.appium.io/t/xcodebuild-failed-with-code-65-warning-the-server-did-not-provide-any-stacktrace-information-command-duration-or-timeout-32-63-seconds/12756/4

1) You need to create one config file "xcodeConfigFile "under webDriverRunner project
2) Mention your team id properly, You can find your Team ID using your developer account. Sign in to developer.apple.com/account, and click Membership in the sidebar. Your Team ID appears in the Membership Information section under the team name. 
3) Mention this config file inside your desired capabilities as:
capabilities.setCapability("xcodeConfigFile", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig");

Path of your xcodeConfigFile may vary.

i read on another thread for mac users if you move the appim.app into the applications folder it works i tried it myself and it deffo worked.

Yep @AutomationProjects , that's what did it for me. I had Appium.app in /Downloads and it never worked (the simluator loaded but no inspector).

Moved Appium.app to /Applications and both simulator + inpsector run (with app auto-loaded). So simple yet spent so much time looking around

@AutomationProjects @alexandlazaris voila! it worked for me too. moving the Appium app to /Applications worked for me. Thanks for your help.

I am facing the same issue : "getting error Unable to launch WebDriverAgent because of xcodebuild failure: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1"

I am trying to upgrade my scripts to support for iOS 9.3 or later-
I am using -

Mac OS 10.11.6
Xcode 8.0/8.2(tried with both)
iPhone 6 - iOS 10.1.1
Appium 1.6.5

Please do let me know if any unmatched supported version is there, if not then-

There are two things i want to add from this discussion forum :

  1. I don't have Carthage installed, and when I try to do so, it asks for Xcode 9.0 which ultimately needs Mac OS 10.12 or later [is this the only way out?]

if above is not the problem-

  1. I cannot find the path : "cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/bin/bash Scripts/bootstrap.sh -d"

@amiteshri92 This is code signing issue, it happens when setup for appium have some problem in configuring webdriver-agent in appium library, you can even configure webdriver-agent with free apple developer account as well, follow these steps in video: https://www.youtube.com/watch?v=dyijACVRQOc It worked for me, hope it will help everybody here!

@swachhab I don't think it is possible to run appium test without paying for Developer program. I have tried this and appium fails to get the provisioning profile/certificate.

@imurchie @jlipps Can you please confirm on @swachhab comment?
Thankyou in advance :)

You are very much able to use a Free Developer Account. There are a few caveats:

  • free accounts can only sign two apps at a time. Since Appium needs to sign an app itself, this means that only one other app can be signed when a session is started
  • free accounts cannot use wildcard certificates, which might mean that WebDriverAgent, which Appium needs to sign, may need a different bundle identifier in order to be signed (not sure why Apple reject the default one at times).

This is all described in our documentation: http://appium.io/docs/en/drivers/ios-xcuitest-real-devices/

@imurchie's comment very much make sense!
@prateekchawla Have you seen that video?, I tried same steps and its working absolutely fine for me.
Still in any doubt than you can visit this page: https://mobileautotools.wordpress.com/appium-setup-for-ios-10/

@prateekchawla but yeah we face issue sometimes in between our regression suite if we provide free developer account and run parallel test cases. Otherwise on single device, it execute smoothly with free developer account.

Thanks @imurchie @jlipps @emil-petersen @vikramvi
I was able to resolve the issue, it was more related to code-signing and using web driver runner agent.

@prateekchawla you never mentioned about the solution. How did you solve it? I am running through the similar issue and unable to find any solution

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings