calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 368 forks source link

Xcode 11: Could not find a device with a UDID or name matching '' (ArgumentError) #1417

Closed stereotype013 closed 4 years ago

stereotype013 commented 4 years ago

Hello, we use calabash 3 years without problems, thank you for your support. So we have a problem when Xcode 11 and new simulators were released. I use this terminal command all time long:

DEVICE_TARGET=EC175FE0-3F91-4FA0-AD54-1516299359BD APP_BUNDLE_PATH=<path_to_app>.app DEBUG=1 bundle exec cucumber features/1.feature

Dependencies in my Gemfile are:

`# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "rails"

gem 'calabash-android', '0.9.9' gem 'cucumber', '2.99.0' gem 'calabash-cucumber' gem 'require_all' gem 'rake' gem 'pry' gem 'parallel_calabash' gem 'json', '1.8.6' gem 'test-unit' gem 'CFPropertyList', '2.2.8' gem 'rest-client' gem 'syntax' gem 'httpclient', '2.8.3' gem 'rspec-expectations' gem 'SurfCustomCalabash', '0.1.7' gem 'unicode' gem 'run_loop', '>=4.2.2' gem 'concurrent-ruby', '1.1.5'

`

So, I got error when I run command above:

`macbook-tolubaev:tests$ DEVICE_TARGET=EC175FE0-3F91-4FA0-AD54-1516299359BD APP_BUNDLE_PATH=/Users/tolubaev/Library/Developer/Xcode/DerivedData/App-cdeyrhkscafgrmhjrasotalwffga/Build/Products/Debug-iphonesimulator/App-cal.app DEBUG=1 bundle exec cucumber features/1.feature

Using the ios profile... language: ru

Функция: Сценарии проверки главной страницы

SHELL: xcrun simctl list devices --json SHELL: xcrun instruments -s devices

@reinstall Сценарий: Новый # features/1.feature:8 Could not find a device with a UDID or name matching 'EC175FE0-3F91-4FA0-AD54-1516299359BD' (ArgumentError) ./features/ios/support/01_launch.rb:44:in `Before' Когда Я запускаю приложение # features/step_definitions/inv+auth.rb:6

И Я вижу Главный экран                     # features/step_definitions/inv+auth.rb:157

Retrying.. Errno::ECONNREFUSED: (Connection refused - Connection refused - connect(2) for "127.0.0.1" port 37265 (127.0.0.1:37265))

Retrying.. Errno::ECONNREFUSED: (Connection refused - Connection refused - connect(2) for "127.0.0.1" port 37265 (127.0.0.1:37265)) Failing... Errno::ECONNREFUSED

  Connection refused - Connection refused - connect(2) for "127.0.0.1" port 37265 (127.0.0.1:37265) (Errno::ECONNREFUSED)

  ./features/ios/support/01_launch.rb:74:in `After'

SHELL: xcrun simctl list devices --json `

My simulator with this UDID is launched, Build is ready. Sorry for scenario in Russian, I can change it if you want.

If any details are necessary I'll show.

Thank you!

JoeSSS commented 4 years ago

Are you sure that device EC175FE0-3F91-4FA0-AD54-1516299359BD is still available in Xcode 11? you can try to perform the same command that calabash does - xcrun simctl list devices --json

stereotype013 commented 4 years ago

Yes, sure, I copied from Xcode (Devices and simulators).

{ "devices" : { "com.apple.CoreSimulator.SimRuntime.watchOS-6-0" : [ { "state" : "Shutdown", "isAvailable" : true, "name" : "Apple Watch Series 4 - 40mm", "udid" : "39A98D73-E927-4420-B544-E459A8FF1C1C" }, { "state" : "Shutdown", "isAvailable" : true, "name" : "Apple Watch Series 4 - 44mm", "udid" : "C6E0E785-6A9F-41C5-8CE8-42CD9FA1D89A" }, { "state" : "Shutdown", "isAvailable" : true, "name" : "Apple Watch Series 5 - 40mm", "udid" : "4A905579-C981-4A94-8C3B-38305A750249" }, { "state" : "Shutdown", "isAvailable" : true, "name" : "Apple Watch Series 5 - 44mm", "udid" : "9D201468-5DD5-41DB-B040-0E323B6FB408" } ], "com.apple.CoreSimulator.SimRuntime.iOS-13-1" : [ { "state" : "Shutdown", "isAvailable" : true, "name" : "iPhone 8", "udid" : "EC175FE0-3F91-4FA0-AD54-1516299359BD" }....

JoeSSS commented 4 years ago

can't you just use DEVICE_TARGET="iPhone 8 (13.0)" instead of udid?

stereotype013 commented 4 years ago

Yes, tried, unfortunately similar problem:

Could not find a device with a UDID or name matching 'iPhone 8 (13.0)' (ArgumentError) ./features/ios/support/01_launch.rb:44:inBefore' `

JoeSSS commented 4 years ago

are yous sure that you changed your xcode-select to look into the new build tools?

JoeSSS commented 4 years ago
Screenshot 2019-10-09 at 15 33 27

e.g. here you should have Xcode 11

stereotype013 commented 4 years ago

yes, command line tools are right, no any variants. I don't know exactly, but I am fear that it's necessary to change some parser functions for run_loop with new version of Xcode(

image

JoeSSS commented 4 years ago

are you by any chance still have older xcode on your machine?

JoeSSS commented 4 years ago

Also which run-loop and calabash-cucumber versions are actually used? do you use 4.4.1 and 0.21.10? Older versions wouldn't work with new Xcode exactly because of inability of reading xcrun output

stereotype013 commented 4 years ago

No, old version was updated by new version:

 /usr/bin/xcodebuild -version
Xcode 11.1
Build version 11A1027

Version of run_loop is 4.2.2 and calabash-cucumber is 0.21.10:

qa-macbook-tolubaev: tolubaev$ gem list

*** LOCAL GEMS ***

activesupport (4.2.11.1, 4.2.11, 3.2.22.5)
addressable (2.6.0)
appium_lib (9.18.0, 9.7.4)
appium_lib_core (3.2.2, 2.3.4)
atomos (0.1.3)
awesome_print (1.8.0)
babosa (1.0.2)
backports (3.15.0)
bigdecimal (default: 1.3.4)
builder (3.2.3)
bundler (1.17.3, 1.17.2)
calabash-android (0.9.9, 0.9.8)
calabash-cucumber (0.21.10)
CFPropertyList (3.0.0, 2.3.6, 2.2.8)
childprocess (1.0.1, 0.8.0)
chronic_duration (0.10.6)
claide (1.0.2)
clipboard (1.3.3)
cmath (default: 1.0.0)
cocoapods (1.7.2, 1.6.0.beta.2)
cocoapods-core (1.7.2, 1.6.0.beta.2)
cocoapods-deintegrate (1.0.4, 1.0.3)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-try (1.1.0)
coderay (1.1.2)
colored (1.2)
colored2 (3.1.2)
command_runner_ng (0.1.4)
commander-fastlane (4.4.6)
concurrent-ruby (1.1.5, 1.1.4)
csv (default: 1.0.0)
cucumber (3.1.2, 2.99.0, 2.4.0, 1.3.20)
cucumber-core (3.2.1, 1.5.0)
cucumber-expressions (6.0.1)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
cucumber_in_groups (0.0.2)
date (default: 1.0.0)
dbm (default: 1.0.0)
declarative (0.0.10)
declarative-option (0.1.0)
did_you_mean (1.2.0)
diff-lcs (1.3)
domain_name (0.5.20190701, 0.5.20180417, 0.5.20170404)
dotenv (2.7.4, 2.7.1)
edn (1.1.1)
emoji_regex (0.1.1)
escape (0.0.4)
etc (default: 1.0.0)
eventmachine (1.2.7)
excon (0.64.0, 0.62.0)
faraday (0.15.4)
faraday-cookie_jar (0.0.6)
faraday_middleware (0.13.1)
fastimage (2.1.5)
fastlane (2.108.0, 2.78.0)
fastlane-plugin-git_tags (0.1.1)
fastlane-plugin-versioning (0.3.4)
faye-websocket (0.10.9)
fcntl (default: 1.0.0)
ffi (1.9.18)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
fourflusher (2.3.1, 2.0.1)
fuzzy_match (2.0.4)
geocoder (1.5.1)
gh_inspector (1.1.3)
gherkin (5.1.0, 4.1.3, 2.12.2)
git (1.2.9.1)
google-api-client (0.23.9, 0.13.6)
googleauth (0.8.0, 0.6.7)
highline (1.7.10)
http-cookie (1.0.3)
httpclient (2.8.3)
i18n (0.9.5)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
json (2.2.0, default: 2.1.0, 1.8.6)
jwt (2.2.1, 2.1.0)
liquid (4.0.0)
luffa (2.1.0)
memoist (0.16.0)
method_source (0.9.2)
mime-types (3.2.2, 3.1)
mime-types-data (3.2019.0331, 3.2018.0812, 3.2016.0521)
mini_magick (4.5.1)
mini_portile2 (2.4.0, 2.3.0)
minitest (5.11.3, 5.10.3)
molinillo (0.6.6)
multi_json (1.13.1, 1.12.2)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
nap (1.1.0)
naturally (2.2.0)
net-telnet (0.1.1)
netrc (0.11.0)
nokogiri (1.10.4, 1.8.1)
numerizer (0.1.1)
openssl (default: 2.1.0)
os (1.0.1, 1.0.0)
parallel (1.17.0)
parallel_calabash (0.2.4)
plist (3.5.0)
power_assert (1.1.5, 1.1.4, 1.1.1)
pry (0.12.2)
psych (default: 3.0.2)
public_suffix (2.0.5)
rake (12.3.3, 12.3.2, 12.3.0)
rdoc (default: 6.0.1)
representable (3.0.4)
require_all (2.0.0)
rest-client (2.0.2)
retriable (3.1.2, 2.0.2)
rouge (2.0.7)
rspec (3.8.0, 3.6.0)
rspec-core (3.8.2, 3.6.0)
rspec-expectations (3.8.4, 3.8.2, 3.6.0)
rspec-mocks (3.8.1, 3.6.0)
rspec-support (3.8.2, 3.8.0, 3.6.0)
ruby-macho (1.4.0)
rubyzip (1.2.4, 1.2.3, 1.2.2, 1.2.1)
run_loop (4.2.2)
sauce_whisk (0.1.0, 0.0.22)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
security (0.1.3)
selenium-webdriver (3.142.3, 3.6.0)
signet (0.11.0)
simctl (1.6.5)
slack-notifier (2.3.2)
slowhandcuke (0.0.3)
spec (5.3.4)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
SurfCustomCalabash (0.1.7)
syntax (1.2.2)
terminal-notifier (1.8.0)
terminal-table (1.4.5)
test-unit (3.3.2, 3.2.9, 3.2.7, 2.5.5)
thor (0.20.3, 0.19.1)
thread_safe (0.3.6)
tomlrb (1.2.8, 1.2.6)
tty-cursor (0.7.0, 0.6.1)
tty-screen (0.7.0, 0.6.5)
tty-spinner (0.9.1, 0.9.0)
tzinfo (1.2.5)
uber (0.1.0)
unf (0.1.4)
unf_ext (0.0.7.6, 0.0.7.5, 0.0.7.4)
unicode (0.4.4.4)
webrick (default: 1.4.2)
websocket-driver (0.7.1)
websocket-extensions (0.1.4)
word_wrap (1.0.0)
xcodeproj (1.11.0, 1.8.1)
xcpretty (0.3.0)
xcpretty-travis-formatter (1.0.0)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

Do you use Xcode 11 too or another versions? If Xcode 11, is everything ok?

JoeSSS commented 4 years ago

run-loop 4.2.2 won't work. Please update

stereotype013 commented 4 years ago

Yes, it helps! Thank you and sorry to trouble you, condition >= 4.2.2 was not correct in my Gemfile.