Skip to content

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

Closed
@ssynix

Description

@ssynix

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

Activity

imurchie

imurchie commented on Aug 22, 2016

@imurchie
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

ssynix commented on Aug 22, 2016

@ssynix
Author

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

imurchie commented on Aug 22, 2016

@imurchie
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

ssynix commented on Aug 22, 2016

@ssynix
Author

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

ssynix commented on Aug 24, 2016

@ssynix
Author

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

skumar1122

skumar1122 commented on Aug 25, 2016

@skumar1122

@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

imurchie commented on Aug 25, 2016

@imurchie
Contributor

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

riadcse07

riadcse07 commented on Aug 29, 2016

@riadcse07

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

SrinivasanTarget commented on Aug 31, 2016

@SrinivasanTarget
Member

@triager please label: Bug

added
Buga problem that needs fixing
and removed
Needs Triagebugs which are not yet confirmed
on Aug 31, 2016
ssynix

ssynix commented on Aug 31, 2016

@ssynix
Author

@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

codehunterridoy commented on Sep 1, 2016

@codehunterridoy

@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

THIRISANGU commented on Sep 6, 2016

@THIRISANGU

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

25 remaining items

kirangowdawestwing

kirangowdawestwing commented on Nov 15, 2016

@kirangowdawestwing

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

dayanacgeorge

dayanacgeorge commented on Nov 15, 2016

@dayanacgeorge

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

imurchie commented on Nov 15, 2016

@imurchie
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

dayanacgeorge commented on Nov 16, 2016

@dayanacgeorge

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

imurchie commented on Nov 16, 2016

@imurchie
Contributor

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

dayanacgeorge

dayanacgeorge commented on Nov 16, 2016

@dayanacgeorge

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

dayanacgeorge

dayanacgeorge commented on Nov 28, 2016

@dayanacgeorge

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

kommuswamy commented on Dec 7, 2016

@kommuswamy

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

vikramvi commented on Dec 8, 2016

@vikramvi
Contributor

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

shabana-parveen

shabana-parveen commented on Dec 9, 2016

@shabana-parveen

@kommuswamy , please increase app launch time.

mollywhitnack

mollywhitnack commented on Dec 13, 2016

@mollywhitnack

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

timcallanan2 commented on Jan 26, 2017

@timcallanan2

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

lock commented on Apr 29, 2019

@lock

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.

locked and limited conversation to collaborators on Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Buga problem that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @vikramvi@joelneubert@THIRISANGU@imurchie@amedvedjev

        Issue actions

          Problems setting up appium-1.6.0-beta1 for XCUITesting · Issue #6759 · appium/appium