Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems setting up appium-1.6.0-beta1 for XCUITesting #6759

Closed
ssynix opened this issue Aug 22, 2016 · 49 comments
Closed

Problems setting up appium-1.6.0-beta1 for XCUITesting #6759

ssynix opened this issue Aug 22, 2016 · 49 comments
Labels
Bug a problem that needs fixing

Comments

@ssynix
Copy link

ssynix commented Aug 22, 2016

The problem

I ran into a couple of issues setting up the 1.6.0-beta1 driver for iOS 10 simulator testing with the XCUITestDriver.

2016-08-22 09:10:10:384 - [XCUITest] Launching WebDriverAgent on the device
2016-08-22 09:10:10:386 - [debug] [XCUITest] Running WebDriverAgent bootstrap script to install dependencies
2016-08-22 09:10:11:499 - [XCUITest] Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (lib/teen_process.js:66:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
 { Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (lib/teen_process.js:66:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
  stdout: '\u001b[1mFetching dependencies\n*** Downloading KissXML.framework binary at "5.0.5"\n*** Downloading peertalk.framework binary at "v1.0"\n',
  stderr: 'A shell task (/usr/bin/env unzip -qq -d /var/folders/2x/nx56z5rx0rn94pps7f15frx4bpqmmv/T/carthage-archive.8k9Nqk /Users/shayansa/Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip) failed with exit code 9:\n[/Users/shayansa/Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip]\n  End-of-central-directory signature not found.  Either this file is not\n  a zipfile, or it constitutes one disk of a multi-part archive.  In the\n  latter case the central directory and zipfile comment will be found on\n  the last disk(s) of this archive.\nunzip:  cannot find zipfile directory in one of /Users/shayansa/Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip or\n        /Users/shayansa/Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip.zip, and cannot find /Users/shayansa/Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip.ZIP, period.\n\n',
  code: 1 }
2016-08-22 09:10:11:501 - [XCUITest] Shutting down WebDriverAgent
2016-08-22 09:10:11:506 - [debug] [iOSLog] Stopping iOS log capture
2016-08-22 09:10:11:519 - [MJSONWP] Encountered internal error running command: Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (lib/teen_process.js:66:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
2016-08-22 09:10:11:527 - [HTTP] <-- POST /wd/hub/session 500 3921 ms - 199

It mentions that it has a problem reading a zip archive. I looked into it and realized that the zip archive is actually this text file:

{"message":"API rate limit exceeded for <blipped ip address>. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}

Probably because of how our internal corporate network works.

I ran ./Scripts/bootstrap.sh in the WebDriverAgent folder, which resulted in sh: webpack: command not found. I resolved it by npm i -g webpack.

Afterwards, the bootstrap.sh script finished the build successfully, even though it printed one error and it still mentioned that it skipped downloading packages due to an API limit being reached.

I managed to trigger the creation of an iOSDriver (instead of XCUITest) on my first almost successful attempt, which led to:

[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium]   app: '/Users/shayansa/Downloads/ios/my.simulator.app'
[Appium]   noReset: true
[Appium]   newCommandTimeout: 7200
[Appium]   platformVersion: '10.0'
[Appium]   automationName: 'XCUITest'
[Appium]   sessionOverride: true
[Appium]   platformName: 'iOS'
[Appium]   deviceName: 'iPhone 6s Plus'
[BaseDriver] SessionNotCreatedError: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): automationName XCUITest not part of Appium,Selendroid,WebDriverAgent.

I don't recall changing anything in my config, but I couldn't reproduce the issue above.

After all this, I managed to run the app on the iOS 10 simulator and execute some basic commands.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.0-beta1
  • Desktop OS/version used to run Appium: OSX El Capitan
@triager triager added the Needs Triage bugs which are not yet confirmed label Aug 22, 2016
@imurchie
Copy link
Contributor

I'm not sure that Appium can do anything about the rate limiting.

The webpack error is avoidable by using the -d flag to ./Scripts/bootstrap.sh, as Appium does.

When you say you could not reproduce the issue above, which issue are you referring to.

@ssynix
Copy link
Author

ssynix commented Aug 22, 2016

The problem with rate limiting is that running the script manually resulted in a build that appium was able to use, even though it still generated log messages about rate limiting. Maybe the script is returning an error status where it shouldn't, and Appium is treating it as a fatal error.

My bad, I missed the -d flag.

I was about to edit the issue, but shortly after submitting it I realized that the SessionNotCreatedError was due to mistakenly running appium from a terminal window that I used for appium 1.5.3, which is why I wasn't able to reproduce it after I correctly started appium 1.6.0.

@imurchie
Copy link
Contributor

Interesting. I'll look into how to test that.

If peertalk has really failed to download, I don't think you would be able to test on a real device.

@ssynix
Copy link
Author

ssynix commented Aug 22, 2016

I haven't had a chance to look into real device testing, which might be why I haven't run into any issues with it yet.

I'll keep you updated if I find a solution on my end.

@ssynix
Copy link
Author

ssynix commented Aug 24, 2016

I modified the bootstrap.sh script to call carthage bootstrap--use-ssh, which avoided the API rate limiting issue.

@skumar1122
Copy link

@ssynix @imurchie
on interest have you tried on Real devices? I am trying to run iOS 9.3.4 first and iOS 10.0 versions.
pre-requisites -
Appium 1.6.0-beta1
Xcode 8 beta
iOS 10.0 devices
and with new capability - Automation name = XCUITest
Am i missing anything new ?

can you please let me know.
Thanks
Shiva

@imurchie
Copy link
Contributor

You will need Carthage installed, and libimobiledevice. See https://github.com/appium/appium-xcuitest-driver#external-dependencies

@riadcse07
Copy link

riadcse07 commented Aug 29, 2016

I followed @ssynix procedure and finally got the below error in terminal

[XCUITest] 2016-08-29 14:45:44.980 xcodebuild[4493:60451] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7fd0d5311b60>

[XCUITest]
Testing failed:

[XCUITest] ./Scripts/generate_modules.sh: line 15: Modules/module.modulemap: Permission denied
** TEST FAILED **

The following build commands failed:
PhaseScriptExecution Generate\ modules /Users//Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates/WebDriverAgent.build/Debug-iphonesimulator/WebDriverAgentLib.build/Script-AD35D0281CF1B37A00870A75.sh
(1 failure)

[XCUITest] xcodebuild exited with code '65' and signal 'null'
[XCUITest] Error: xcodebuild failed with code 65
at SubProcess. (lib/webdriveragent.js:214:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
Error: xcodebuild failed with code 65
at SubProcess. (lib/webdriveragent.js:214:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[XCUITest] Shutting down WebDriverAgent
[XCUITest] Simulator log exited with code 'null'
[debug] [XCUITest] Resetting simulator
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: xcodebuild failed with code 65
at SubProcess. (lib/webdriveragent.js:214:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
[HTTP] <-- POST /wd/hub/session 500 198442 ms - 167

@SrinivasanTarget
Copy link
Member

@triager please label: Bug

@triager triager added Bug a problem that needs fixing and removed Needs Triage bugs which are not yet confirmed labels Aug 31, 2016
@ssynix
Copy link
Author

ssynix commented Aug 31, 2016

@SrinivasanTarget my problems have all been resolved (at least the ones in the original post). It was all user-error on my end except the API rate limit being reached using carthage, which I filed here: facebookarchive/WebDriverAgent#260.

@codehunterridoy
Copy link

@ssynix could you please help me out how i can run appium 1.6.0 beta 1 on iOS 10 simulator using java client.

@THIRISANGU
Copy link

Here are the log details for my current issue. I am using Appium 1.6.0beta1 with java for execution.

XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj

[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

[XCUITest] Launching WebDriverAgent on the device
[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:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
{ Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
at ChildProcess. (lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
stdout: '\u001b[1mFetching dependencies\n*** Downloading KissXML.framework binary at "5.0.5"\n*** Downloading RoutingHTTPServer.framework binary at "v1.0.1"\n',
stderr: '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=0x7fbf2a432120 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}\n',
code: 1 }

[XCUITest] Shutting down WebDriverAgent
[debug] [XCUITest] Resetting simulator

@codehunterridoy
Copy link

codehunterridoy commented Sep 7, 2016

@THIRISANGU please run ./Scripts/bootstrap.sh in the WebDriverAgent folder, which may resulted in sh: webpack: command not found. Then resolved it by npm i -g webpack.

Then please let us know your feedback.

@imurchie
Copy link
Contributor

imurchie commented Sep 7, 2016

If you run (as Appium does) ./Scripts/bootstrap.sh -d the webpack dependency is not necessary.

The underlying problem is a permissions one. This is something that you'll have to resolved locally.

@amedvedjev
Copy link
Contributor

amedvedjev commented Sep 20, 2016

meet same.

  1. installed xCode 8.0
  2. updated appium to 1.6.0-beta1

Result of request is:

aleks:appium-instruments Aleksei$ cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
aleks:WebDriverAgent Aleksei$ ./Scripts/bootstrap.sh -d
Fetching dependencies
Please make sure that you have Carthage installed (https://github.com/Carthage/Carthage)
Note: We are expecting that carthage installed in /usr/local/bin/
aleks:WebDriverAgent Aleksei$ 

after that in same folder did:

brew install carthage
./Scripts/bootstrap.sh -d

and got it WORKING :-)

@imurchie
Copy link
Contributor

You should not need to run that command manually under normal conditions. Appium will do so automatically. In a release later this morning we will have better logging for people who don't have Carthage installed.

@shabana-parveen
Copy link

shabana-parveen commented Oct 19, 2016

I am getting the same error, while upgrading to appium 1.6.0-beta1 version.

 ./Scripts/bootstrap.sh -d
Fetching dependencies
Please make sure that you have Carthage installed (https://github.com/Carthage/Carthage)
Note: We are expecting that carthage installed in /usr/local/bin/
GGNF1882s-MacBook-Pro:WebDriverAgent f2849$ brew install carthage
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
==> Cloning https://github.com/Carthage/Carthage.git
Updating /Library/Caches/Homebrew/carthage--git
==> Checking out tag 0.16.2
Synchronizing submodule url for 'Carthage/Checkouts/Curry'
Synchronizing submodule url for 'Carthage/Checkouts/Runes'
Synchronizing submodule url for 'Carthage/Checkouts/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Quick'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/xcconfigs'
Synchronizing submodule url for 'Externals/Nimble'
Synchronizing submodule url for 'Supporting Files/Configuration'
Synchronizing submodule url for 'Externals/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Quick'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/xcconfigs'
Synchronizing submodule url for 'Externals/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Quick'
Synchronizing submodule url for 'Carthage/Checkouts/ReactiveCocoa'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/xcconfigs'
Synchronizing submodule url for 'Externals/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Quick'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/xcconfigs'
Synchronizing submodule url for 'Externals/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Argo'
Synchronizing submodule url for 'Carthage/Checkouts/Curry'
Synchronizing submodule url for 'Carthage/Checkouts/OHHTTPStubs'
Synchronizing submodule url for 'Carthage/Checkouts/ReactiveCocoa'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/Curry'
Synchronizing submodule url for 'Carthage/Checkouts/Runes'
Synchronizing submodule url for 'Carthage/Checkouts/Nimble'
Synchronizing submodule url for 'Carthage/Checkouts/Quick'
Synchronizing submodule url for 'Carthage/Checkouts/Result'
Synchronizing submodule url for 'Carthage/Checkouts/xcconfigs'
Synchronizing submodule url for 'Externals/Nimble'
==> make prefix_install PREFIX=/usr/local/Cellar/carthage/0.16.2
Last 15 lines from /Users/f2849/Library/Logs/Homebrew/carthage/01.make:
=== CLEAN TARGET Curry-Mac OF PROJECT Curry WITH CONFIGURATION Release ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** CLEAN FAILED **


The following build commands failed:
    Check dependencies
    Check dependencies
    Check dependencies
    Check dependencies
(4 failures)
make: *** [clean] Error 65
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Homebrew/homebrew-core/issues

Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

@shabana-parveen
Copy link

shabana-parveen commented Oct 19, 2016

please share what exact version I have to install and when will we get the stable build, I am getting stuck here as my app is fully upgrade according to xcode8 with latest swift and OS version, but Appium version some how not supported.

PS: Also, Please ASAP app version as well.

Thanks
Shabana Parveen

@imurchie
Copy link
Contributor

You need to upgrade homebrew.

brew update

And then retry installing Carthage.

@shabana-parveen
Copy link

shabana-parveen commented Oct 20, 2016

Hey @imurchie , thanks for reply, I update it, now I got below error ; To resolve below error I run above suggested command (chmod: /Users/F2849/.npm-packages/lib/node_modules/appium/node_modules/appium-xcuitest-driver) then got error : No such file or directory Also I got the idea, why it showing No file directory as I m not having .npm-package directory in my local machine.

WebDriverAgent f2849$ ./Scripts/bootstrap.sh -d
Fetching dependencies
*** Downloading KissXML.framework binary at "5.0.5"
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=0x7f9cc7d086c0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

@imurchie
Copy link
Contributor

I am not sure where you got that command. But the path is to someone else's installation. You appear to have appium installed in /usr/local/lib/node_modules/appium/.

So you need to change the permissions or ownership on that tree.

@shabana-parveen
Copy link

for command its a typo error from my side, sorry for that, so for providing permission I used command : sudo chmod -R 777 /Users/F2849/.npm-packages/lib/node_modules/appium/node_modules/appium-xcuitest-driver/

(Please refer @Hellengo comment on #6853 (comment) )

@imurchie
Copy link
Contributor

And there is still a problem?

@shabana-parveen
Copy link

Yes

@shabana-parveen
Copy link

shabana-parveen commented Oct 21, 2016

Hello @imurchie , I have observed one more point as well, plz check my highlighted log points below as I mentioned launch timeout around 90000 in my script but appium 1.6.0 version shows default timeout is 6000ms, I checked it with older appium version it working as per launch timeout is given on the script(might be I m wrong but I think their might be an issue):

[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/f2849/Desktop/ShineDev2016-10-14/ShineDev.ipa'
[Appium] sendKeyStrategy: 'grouped'
[Appium] platformVersion: '10.0'
[Appium] automationName: 'XCUITest'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'iPhone 5'
# [Appium] launchTimeout: 90000
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: ac6bf058-5805-456e-9cb2-c9bbd2d0e8eb
[debug] [XCUITest] Xcode version set to '8.0'
[debug] [XCUITest] iOS SDK Version set to '10.0'
[iOSSim] Constructing iOS simulator for Xcode version 8.0 with udid '4FE61E16-B812-4E15-9A7B-9DC062CB10F3'
[XCUITest] Determining device to run tests on: udid: '4FE61E16-B812-4E15-9A7B-9DC062CB10F3', real device: false
[BaseDriver] Using local app '/Users/f2849/Desktop/ShineDev2016-10-14/ShineDev.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/st/41dk4fnd10518617jytfvjhh0000gq/T/2016921-2785-cb9wat.lx04ibe29/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/st/41dk4fnd10518617jytfvjhh0000gq/T/2016921-2785-cb9wat.lx04ibe29/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/st/41dk4fnd10518617jytfvjhh0000gq/T/2016921-2785-cb9wat.lx04ibe29/Payload/ShineDev.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [ios-app-utils] Getting bundle ID from app
[debug] [iOSLog] Starting iOS 10.0 simulator log capture
[debug] [iOSLog] System log path: /Users/f2849/Library/Logs/CoreSimulator/4FE61E16-B812-4E15-9A7B-9DC062CB10F3/system.log
[XCUITest] Setting up simulator
[debug] [iOS] No reason to set locale
[debug] [iOS] No iOS / app preferences to set
[XCUITest] Simulator with udid '4FE61E16-B812-4E15-9A7B-9DC062CB10F3' not booted. Booting up now
[debug] [iOSSim] Killing all iOS Simulators
[iOSSim] Starting simulator with command: open /Users/f2849/Documents/NewVolume/Softwares/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 4FE61E16-B812-4E15-9A7B-9DC062CB10F3
[iOSSim] Tailing simulator logs until we encounter the string "SMS Plugin initialized"
## [iOSSim] We will time out after 60000ms
[debug] [iOSSim] Simulator startup timed out. Continuing anyway.
[debug] [iOSSim] Waiting an extra 10000ms for the simulator to really finish booting
[debug] [iOSSim] Done waiting extra time for simulator
[iOSSim] Simulator booted in 70354ms
[debug] [XCUITest] Installing app '/var/folders/st/41dk4fnd10518617jytfvjhh0000gq/T/2016921-2785-cb9wat.lx04ibe29/Payload/ShineDev.app' on device
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[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:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
{ Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
at ChildProcess. (lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
stdout: '\u001b[1mFetching dependencies\n*** Downloading KissXML.framework binary at "5.0.5"\n',
stderr: '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=0x7ff3c952bda0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}\n',
code: 1 }

@imurchie
Copy link
Contributor

The launch timeout is the launch of the app, not the simulator. The timeout should not affect things, unless the sim is actually not opened.

The issue is still that you don't have permission to write to /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Carthage/Build/iOS. I thought you had changed the permissions for /usr/local/lib/node_modules/appium and below?

@lvconley
Copy link

lvconley commented Nov 5, 2016

I'm using Appium 1.6.0 and getting the following error every time I try to run any of my test cases:

[MJSONWP] Encountered internal error running command: Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1

I'd love to get any feedback on what could be causing this!

Here is the whole log (I've cleansed various unique identifiers with 000's):

[Appium] Welcome to Appium v1.6.0
[Appium] Non-default server args:
[Appium] address: '127.0.0.1'
[Appium] sessionOverride: true
[Appium] defaultCommandTimeout: 60000
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/myHomeDir/Library/Developer/Xcode/DerivedData/MyPlatform-mcmrxbgvjoheqkbgjqqgyefzxitk/Build/Products/Debug-iphonesimulator/DLR.app","platformVersion":"10.0","automationName":"XCUITest","bundleId":null,"waitForAppScript":"$.delay(3000);$.acceptAlert();","platformName":"iOS","deviceName":"iPhone 6s"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/myHomeDir/Li...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/myHomeDir/Library/Developer/Xcode/DerivedData/MyPlatform-mcmrxbgvjoheqkbgjqqgyefzxitk/Build/Products/Debug-iphonesimulator/DLR.app'
[Appium] platformVersion: '10.0'
[Appium] automationName: 'XCUITest'
[Appium] bundleId: null
[Appium] waitForAppScript: '$.delay(3000);$.acceptAlert();'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'iPhone 6s'
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: 2ab203fc-9fad-4d43-a93d-97768cd75b36
[debug] [XCUITest] Xcode version set to '8.0'
[debug] [XCUITest] iOS SDK Version set to '10.0'
[iOSSim] Constructing iOS simulator for Xcode version 8.0 with udid '00000000-0000-0000-0000-000000000000'
[XCUITest] Determining device to run tests on: udid: '00000000-0000-0000-0000-000000000000', real device: false
[BaseDriver] Using local app '/Users/myHomeDir/Library/Developer/Xcode/DerivedData/MyPlatform-mcmrxbgvjoheqkbgjqqgyefzxitk/Build/Products/Debug-iphonesimulator/DLR.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [ios-app-utils] Getting bundle ID from app
[debug] [iOSLog] Starting iOS 10.0 simulator log capture
[debug] [iOSLog] System log path: /Users/myHomeDir/Library/Logs/CoreSimulator/00000000-0000-0000-0000-000000000000/system.log
[XCUITest] Setting up simulator
[debug] [iOS] No reason to set locale
[debug] [iOS] No iOS / app preferences to set
[XCUITest] Simulator with udid '00000000-0000-0000-0000-000000000000' not booted. Booting up now
[debug] [iOSSim] Killing all iOS Simulators
[iOSSim] Starting simulator with command: open /Applications/Xcode_8.0.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID 00000000-0000-0000-0000-000000000000
[iOSSim] Tailing simulator logs until we encounter the string "SMS Plugin initialized"
[iOSSim] We will time out after 60000ms
[debug] [iOSSim] Waiting an extra 10000ms for the simulator to really finish booting
[debug] [iOSSim] Done waiting extra time for simulator
[iOSSim] Simulator booted in 26152ms
[debug] [XCUITest] Installing app '/Users/myHomeDir/Library/Developer/Xcode/DerivedData/MyPlatform-mcmrxbgvjoheqkbgjqqgyefzxitk/Build/Products/Debug-iphonesimulator/DLR.app' on device
[XCUITest] Using default agent: /Users/myHomeDir/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /Users/myHomeDir/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Carthage not found. Install using brew install 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:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
{ Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
at ChildProcess. (lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
stdout: '\u001b[1mFetching dependencies\nPlease make sure that you have Carthage installed (https://github.com/Carthage/Carthage)\nNote: We are expecting that carthage installed in /usr/local/bin/\n',
stderr: '',
code: 1 }
[debug] [XCUITest] Running iOS simulator reset flow
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [XCUITest] Cleaning simulator state.
[debug] [iOSSim] Cleaning app data files for 'DLR.app', 'com.myCompany.DLR.dev'
[debug] [iOSSim] Building bundle path map
[debug] [iOSSim] Building bundle path map
[debug] [iOSSim] Deleting directory: '/Users/myHomeDir/Library/Developer/CoreSimulator/Devices/00000000-0000-0000-0000-000000000000/data/Containers/Data/Application/00000000-0000-0000-0000-000000000000'
[debug] [iOSSim] Deleting directory: '/Users/myHomeDir/Library/Developer/CoreSimulator/Devices/00000000-0000-0000-0000-000000000000/data/Containers/Bundle/Application/00000000-0000-0000-0000-000000000000'
[debug] [iOSSim] Deleting file: '/Users/myHomeDir/Library/Developer/CoreSimulator/Devices/Library/Preferences/com.myCompany.DLR.dev.plist'
[debug] [iOSSim] Killing any simulator daemons for 00000000-0000-0000-0000-000000000000
[iOSSim] Cleaning simulator 00000000-0000-0000-0000-000000000000
[debug] [XCUITest] Resetting simulator
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[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:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
[HTTP] <-- POST /wd/hub/session 500 45783 ms - 199

@joelneubert
Copy link

I saw this as well. The error also gives the solution.

'XCUITest] Carthage not found. Install using brew install carthage'

@lvconley
Copy link

lvconley commented Nov 5, 2016

I saw that too and installed Carthage with brew then re-ran and the same error occurred. I wonder if I have to do some special Carthage installation option to get it to install in a specific location for Appium? My understanding of Appium 1.6.0, though, is that Appium is supposed to take care of any required Carthage installation for you.

@mykola-mokhnach
Copy link
Collaborator

@lvconley The only requirement there is that carthage executable should be in PATH and it is visible to Appium server. Type in Terminal

which carthage

and check the output is not empty.

@lvconley
Copy link

lvconley commented Nov 8, 2016

Thanks guys, is working now!

My initial install attempts were not working correctly with Brew, and I kept getting warnings or errors which indicated that the installation may not have fully worked correctly. So, I ran the following command to see what had been installed by brew:

brew list

And carthage was never listed.

So, I did an update of Brew just to make sure I had the latest version:

brew update

And actually encountered permissions errors which I temporarily resolved with brute force:

chmod -R 777 /usr/local

and this allowed the next 'brew update' attempt to complete without any errors. Once brew had been fully updated, the next time I ran:

brew install carthage

The installation completed without any warnings or errors and then when I ran the following command at the terminal:

which carthage

The carthage installation path was instantly displayed.

And then I re-ran my test code, and the test worked perfectly!

Thanks for the tips guys, very helpful!!

@dayanacgeorge
Copy link

I have done all setup which are mentioned in the following link.
https://github.com/appium/appium-xcuitest-driver#external-dependencies

I am in "Real devices>>Configuration>>Manual configuration alternative>> WebDriverAgent needs to be built with development team----
But when I build the WebDriverAgent.xcodeproj, it is failing and giving a Dependency Analysis Error. In folder, Frameworks>>iOS>>RoutingHTTPServer.framework is missing. How to get that for my Test? or How to resolve this issue?
I am new to Appium and I am using real ios device to test a Native iOS app.
Appium : Appium v1.6.1-beta
Xcode : 8.1
Mac: macOS Sierra, MacBook Air, Version:- 10.12
Device: iPad Mini 2

Thanks in advance.
Dayana George

@kirangowdawestwing
Copy link

What is the finial solution for the initial issue posted by @ssynix

@ssynix If you have resolved the problem can you please let me know what is the solution. I am facing the same problem as you faced.

@ssynix
Copy link
Author

ssynix commented Nov 14, 2016

@kirangowdawestwing I ran into a couple of issues initially. Since the driver was in beta at the time, I'm not even sure if they're still relevant. My issues were resolved in the first 5 comments.

For the API rate-limiting issue, one of my coworkers mentioned that Carthage downloaded the dependencies from a mirror after failing to download them from github. That wasn't the case for me so I submitted a PR to WDA to make ./Scripts/bootstrap.sh -D use the --use-ssh flag in Carthage.

@dayanacgeorge
Copy link

dayanacgeorge commented Nov 15, 2016

I have finished with the Certificate signing. When I run the
xcodebuild -project /Users/userabc/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=34c351a1076e2ce9cbc7136f10fb32bc145dcf11' test
command, I am getting this error. Please help on this.

  1. Whether I need to reinstall ./Scripts/bootstrap.sh -d again?
  2. Any idea which will affect badly the xcodeproj signing setting?
  3. Which are all things i need to do after this step?

Running tests...
2016-11-15 16:09:03.729719 XCTRunner[3484:750732] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-11-15 16:09:03.729837 XCTRunner[3484:750732](dlopen_preflight%28/var/containers/Bundle/Application/31943222-0A52-4353-923E-4A83A42CB7F9/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner%29: Library not loaded: @rpath/KissXML.framework/KissXML
Referenced from: /private/var/containers/Bundle/Application/31943222-0A52-4353-923E-4A83A42CB7F9/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
Reason: image not found)
2016-11-15 16:09:03.797 xcodebuild[42315:460176] 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}
MacBook-Air:$ xcodebuild -project /Users/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=34c351a1076e2ce9cbc7136f10fb32bc145dcf11' test
Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)

@imurchie
Copy link
Contributor

Something is broken in your installation. It is not ./Scripts/bootstrap.sh -d, but something in the WebDriverAgent package.

@kirangowdawestwing
Copy link

thanks @imurchie and @ssynix my issue got fixed. It was related to the permissions of the user.

@dayanacgeorge
Copy link

i am following the following link for the installation steps.
https://discuss.appium.io/t/installation-steps-to-get-appium-fully-working-on-macos-10-11/12336/4

  1. Whether i should install the webpack again?
    npm i -g webpack

@imurchie
Copy link
Contributor

You should not need webpack at all. I would re-install the appium-xcuitest-driver, as something seems to have gotten messed up.

@dayanacgeorge
Copy link

MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/3j/093h0g350fb50b5f__530z9h0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/dfe71ce010bede6ea2505507e2698e25/34c351a1076e2ce9cbc7136f10fb32bc145dcf11/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/User1/Library/Developer/Xcode/DerivedData/WebDriverAgent-brjtpqrlumrvdccurmbiooiyxgwd/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/3j/093h0g350fb50b5f__530z9h0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.8uq1Ua/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/3j/093h0g350fb50b5f__530z9h0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.8uq1Ua/WebDriverAgentRunner-Runner.app_sparse.ipa
__MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/3j/093h0g350fb50b5f__530z9h0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.8uq1Ua/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/3j/093h0g350fb50b5f__530z9h0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.8uq1Ua/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
2016-11-16 09:32:58.735475 XCTRunner[3825:776867] Running tests...
2016-11-16 09:32:58.811743 XCTRunner[3825:776867] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-11-16 09:32:58.811871 XCTRunner[3825:776867](dlopen_preflight%28/var/containers/Bundle/Application/57A06B32-3E8A-4BE2-95FF-1467160B823C/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner%29: Library not loaded: @rpath/KissXML.framework/KissXML
Referenced from: /private/var/containers/Bundle/Application/57A06B32-3E8A-4BE2-95FF-1467160B823C/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
Reason: image not found)

2016-11-16 09:33:00.472 xcodebuild[43852:483539] 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}

Testing failed:
Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

Now I am getting this error. how to get the KissXML.framework/KissXML

@imurchie
Copy link
Contributor

The KissXML framework is downloaded when the ./Scripts/bootstrap.sh script is run. Appium does that automatically.

@dayanacgeorge
Copy link

In Integration App >> 'Provisioning profile' signed code is deprecated.
Locally, we can not do the Automatic signing due to the security reasons.

@dayanacgeorge
Copy link

I have done all the signing certificate configurations in Xcode 8.1. But when I execute the following command
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=' test
is giving a TEST FAILED message.

@kommuswamy
Copy link

Hi,

I am unable to launch the iOS simulator in Appium 1.6.2 version. it shows an error like killing all simulator.
i am testing in mac book.

@vikramvi
Copy link
Contributor

vikramvi commented Dec 8, 2016

@kommuswamy this is not related issue, can you open new issue with all the necessary details as mentioned in issue template ?

@shabana-parveen
Copy link

@kommuswamy , please increase app launch time.

@mollywhitnack
Copy link

mollywhitnack commented Dec 13, 2016

I am getting the same error

After running:

appium -a 127.0.01 --safari --webkit-debug-proxy-port 27753 --bootstrap-port 4723 --default-capabilities '{"platformName":"ios", "platformVersion":"10.1.1", "deviceName": "fb50db994718213b571ed87610b50761d856c587","udid":"fb50db994718213b571ed87610b50761d856c587"}'
Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1
    at ChildProcess.<anonymous> (../../lib/teen_process.js:66:19)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:854:16)
    at Socket.<anonymous> (internal/child_process.js:330:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:487:12)
 { [Error: Command '/bin/bash Scripts/bootstrap.sh -d' exited with code 1]
  stdout: '\u001b[1mFetching dependencies\n*** Downloading peertalk.framework binary at "v1.0"\n',
  stderr: 'A shell task (/usr/bin/env unzip -qq -d /var/folders/31/yn4njtbj3gq0fq4hzdb_d8jwc7tmkp/T/carthage-archive.Vk7Mwe /Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip) failed with exit code 9:\n[/Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip]\n  End-of-central-directory signature not found.  Either this file is not\n  a zipfile, or it constitutes one disk of a multi-part archive.  In the\n  latter case the central directory and zipfile comment will be found on\n  the last disk(s) of this archive.\nunzip:  cannot find zipfile directory in one of /Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip or\n        /Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip.zip, and cannot find /Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/1725911-Peertalk.framework.zip.ZIP, period.\n\n',,
  code: 1 }

I ran the ./Scripts/bootstrap.sh -d command to generate the bootstrap.sh file.

When I navigate to
/Users//Library/Caches/org.carthage.CarthageKit/binaries/peertalk/v1.0/
My 1725911-Peertalk.framework.zip file is HTML document text and cannot be unzipped:

file 1725911-Peertalk.framework.zip
1725911-Peertalk.framework.zip: HTML document text
unzip 1725911-Peertalk.framework.zip
Archive:  1725911-Peertalk.framework.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of 1725911-Peertalk.framework.zip or
        1725911-Peertalk.framework.zip.zip, and cannot find 1725911-Peertalk.framework.zip.ZIP, period.

I have carthage version 0.18.1 installed, running Appium 1.6.3 with ios10.1 and xcode 8.1 on osx 10.11.6

@timcallanan2
Copy link

I have a similar problem as @dayanacgeorge using WebDriverAgent that came with Appium 1.6.3 , so I pull the latest version from GITHub https://github.com/facebook/WebDriverAgent and re-built it and I got it working, I suggest replace all files from Appium version with latest files on GIT Hub repro, and rebuild, https://www.youtube.com/watch?v=Yi177Si5aLU#t=3.478444 is a good video to check for all dependencies

@lock
Copy link

lock bot commented Apr 29, 2019

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.

@lock lock bot locked and limited conversation to collaborators Apr 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug a problem that needs fixing
Projects
None yet
Development

No branches or pull requests