appium: Problems setting up appium-1.6.0-beta1 for XCUITesting

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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 49 (15 by maintainers)

Most upvoted comments

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.

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!!

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?