calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 368 forks source link

Calabash doesn't work with Xcode 11 beta 5 #1415

Closed babakansari closed 4 years ago

babakansari commented 4 years ago

Running calabash (calabash-ios 0.21.10) using "Xcode 11 beta 5" throws the following exception when running against iPhone device:

` 2019-08-02 14:13:52.821 iOSDeviceManager[41641:248342] *** Assertion failure in -[FBDeviceControlFrameworkLoader_Xcode loadPrivateFrameworksOrAbort], /Users/maximlobanov/Documents/Repos/TestCloud/FBSimulatorControl/FBControlCore/Utility/FBControlCoreFrameworkLoader.m:84

2019-08-02 14:13:52.825 iOSDeviceManager[41641:248342] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to load private frameworks for FBSimulatorControl with error Error Domain=com.facebook.FBControlCore Code=0 "Attempting to load a file at path '/Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin', but it does not exist" UserInfo={NSLocalizedDescription=Attempting to load a file at path '/Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin', but it does not exist}'

*** First throw call stack: ( 0 CoreFoundation 0x00007fff35c4ecf9 exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff607eaa17 objc_exception_throw + 48 2 CoreFoundation 0x00007fff35c69a16 +[NSException raise:format:arguments:] + 98 3 Foundation 0x00007fff37efbe11 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194 4 FBControlCore 0x000000010968edcb -[FBControlCoreFrameworkLoader loadPrivateFrameworksOrAbort] + 635 5 FBDeviceControl 0x000000010975c94b 33-[FBDeviceSet primeDeviceManager]_block_invoke + 91 6 libdispatch.dylib 0x00007fff61fcb63d _dispatch_client_callout + 8 7 libdispatch.dylib 0x00007fff61fccd4c _dispatch_once_callout + 20 8 FBDeviceControl 0x000000010975c8bd -[FBDeviceSet primeDeviceManager] + 157 9 FBDeviceControl 0x000000010975d483 -[FBDeviceSet dvtDeviceWithUDID:] + 67 10 FBDeviceControl 0x000000010975fe22 -[FBDevice dvtDevice] + 130 11 FBDeviceControl 0x0000000109765543 __63-[FBiOSDeviceOperator waitForDeviceToBecomeAvailableWithError:]_block_invoke + 67 12 FBControlCore 0x000000010965ffd9 -[FBRunLoopSpinner spinUntilTrue:error:] + 201 13 FBDeviceControl 0x0000000109764e9a -[FBiOSDeviceOperator waitForDeviceToBecomeAvailableWithError:] + 298 14 iOSDeviceManager 0x00000001095d8866 +[PhysicalDevice withID:] + 240 15 iOSDeviceManager 0x00000001095e168e +[Device withID:] + 118 16 iOSDeviceManager 0x00000001095e49f3 +[Command deviceFromArgs:] + 130 17 iOSDeviceManager 0x00000001095dbe2c +[InstallAppCommand execute:] + 321 18 iOSDeviceManager 0x00000001095e74d8 +[CLI process:] + 1110 19 iOSDeviceManager 0x00000001095d2951 main + 121 20 libdyld.dylib 0x00007fff620183d5 start + 1 21 ??? 0x0000000000000005 0x0 + 5 ) libc++abi.dylib: terminating with uncaught exception of type NSException [1] 41641 abort install --device-id c57611d0912c5034a72cbe8d53e0a31f0e80c00b `

The command used:

../.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.2.3/lib/run_loop/device_agent/bin/iOSDeviceManager install ../.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.2.3/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app --device-id c57611d091123434a72cbe8d53e0a31f0e80c07b

It seems the calabash-ios-server is not installed on the device correctly. Simulator seems working fine.

jmoody commented 4 years ago

iOSDeviceManager is failing to install the DeviceAgent-Runner app on the simulator.

We have fixed this problem in iOSDeviceManager, but have not released a new version of run-loop. I don't know when I will have a chance. There are several maintainers who could start the release process. I will check to see if anyone is interested on Gitter.

https://gitter.im/calabash/calabash0x?utm_source=share-link&utm_medium=link&utm_campaign=share-link

It seems the calabash-ios-server is not installed on the device correctly

The calabash-ios-server (AKA LPServer, AKA Test Cloud Agent) is embedded in your application.

babakansari commented 4 years ago

@jmoody - I tried the latest run-loop 4.3.0 but still is not working. I can see DeviceAgent-Runner is installed on the device but it is not accessible when running the test.

The exception is:

ERROR: Invalid UDID specified

The UDID from xcrun instruments -s devices command is not 40-digit like before. It is like 00002010-101B12E014E1012D whereas it was 7b0a804bb7193bdf3bb8b0063e7ece741d0c0c38 in the past. Any suggestion?

jmoody commented 4 years ago

I need more context to track down that error. I don't see that text in run-loop or iOSDeviceManager.

What is the stack trace?

I can see DeviceAgent-Runner is installed on the device but it is not accessible when running the test.

If DeviceAgent-Runner is installed, then iOSDeviceManager is working.

You can trace the progress of iOSDeviceManager by watching the log:

$ tail -F ~/.calabash/iOSDeviceManager/logs/current.log
babakansari commented 4 years ago

@jmoody I am using the following command to run the tests on iOS 13.0 device:

AUTOTEST='1' DEVICE_ENDPOINT=http://10.10.111.19:37265 DEVICE_TARGET=00001234-001B64E034D1001E DEVICE_INFO=00001234-001B64E034D1001E BUNDLE_ID=com.test.testMobile bundle exec cucumber -p ios

On terminal it shows the following exception:

An error occurred when running the before scenario function: execution expired

execution expired (HTTPClient::ConnectTimeoutError) ./features/ios/support/01_launch.rb:399:in before_scenario' ./features/ios/support/01_launch.rb:254:inblock (2 levels) in <top (required)>' ./features/ios/support/01_launch.rb:253:in `Before' . . .

Skipping after_scenario function as we are not attached to the automator ERROR: Invalid UDID specified . . .

An error occurred when running the before scenario function: There was an error executing: /Users/bob.ansari/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/bin/iOSDeviceManager install /Users/bob.ansari/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app --device-id 00001234-001B64E034D1001E The command generated this output: There was an error executing: /Users/bob.ansari/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/bin/iOSDeviceManager install /Users/bob.ansari/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app --device-id 00001234-001B64E034D1001E The command generated this output: (RunLoop::Shell::Error) ./features/ios/support/01_launch.rb:399:in before_scenario' ./features/ios/support/01_launch.rb:254:inblock (2 levels) in <top (required)>' ./features/ios/support/01_launch.rb:253:in `Before'

On tail -F ~/.calabash/iOSDeviceManager/logs/current.log it shows:

2019-08-07 09:32:28.055 DEBUG FBControlCoreLogger:281 | Loaded All Private Frameworks [DTXConnectionServices, IDEFoundation, IDEiOSSupportCore, IBAutolayoutFoundation, IDEKit, DFRSupportKit, DVTKit, DebugHierarchyFoundation, DebugHierarchyKit] 2019-08-07 09:32:32.354 ERROR ConsoleWriter:32 | Application com.apple.test.DeviceAgent-Runner is not installed on 00001234-001B64E034D1001E 2019-08-07 09:32:32.789 INFO ConsoleWriter:22 | Using signing identity #<CodesignIdentity: CC953126C99D4B9C243B7B0AA32EA95411E4A123 : iPhone Developer: Bob Ansari (FIV2CX1441)> to select best match profile. 2019-08-07 09:32:32.898 INFO ConsoleWriter:22 | Selected profile #<MobileProfile iOS expired: NO rank: 4> for device 00001234-001B64E034D1001E app com.apple.test.DeviceAgent-Runner 2019-08-07 09:32:33.010 INFO ConsoleWriter:22 | Preparing to resign bundle DeviceAgent-Runner.app with profile iOS Team Provisioning Profile: 2019-08-07 09:32:33.011 INFO ConsoleWriter:22 | Original entitlements: 2019-08-07 09:32:33.012 INFO ConsoleWriter:22 | #<Entitlements: { "keychain-access-groups" : [ "612V32D9TE." ], "com.apple.developer.team-identifier" : "612V32D9TE", "application-identifier" : "612V32D9TE.", "get-task-allow" : true }> 2019-08-07 09:32:33.012 INFO ConsoleWriter:22 | New Entitlements 2019-08-07 09:32:33.012 INFO ConsoleWriter:22 | #<Entitlements: { "get-task-allow" : true, "com.apple.developer.team-identifier" : "612V32D9TE", "application-identifier" : "612V32D9TE.", "keychain-access-groups" : [ "612V32D9TE." ] }> 2019-08-07 09:32:33.012 INFO ConsoleWriter:22 | Resigning to new teamID: 612V32D9TE 2019-08-07 09:32:33.593 INFO ConsoleWriter:22 | resigned object CocoaLumberjack.framework: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:34.182 INFO ConsoleWriter:22 | resigned object XCTAutomationSupport.framework: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:34.842 INFO ConsoleWriter:22 | resigned object XCTest.framework: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | Preparing to resign bundle DeviceAgent.xctest with profile iOS Team Provisioning Profile: 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | Original entitlements: 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | #<Entitlements: { "keychain-access-groups" : [ "612V32D9TE." ], "com.apple.developer.team-identifier" : "612V32D9TE", "application-identifier" : "612V32D9TE.", "get-task-allow" : true }> 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | New Entitlements 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | #<Entitlements: { "get-task-allow" : true, "com.apple.developer.team-identifier" : "612V32D9TE", "application-identifier" : "612V32D9TE.", "keychain-access-groups" : [ "612V32D9TE." ] }> 2019-08-07 09:32:35.176 INFO ConsoleWriter:22 | Resigning to new teamID: 612V32D9TE 2019-08-07 09:32:35.742 INFO ConsoleWriter:22 | resigned object CocoaLumberjack.framework: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:36.162 INFO ConsoleWriter:22 | resigned bundle DeviceAgent.xctest: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:36.162 INFO ConsoleWriter:22 | Done resigning DeviceAgent.xctest with iOS Team Provisioning Profile: . 2019-08-07 09:32:36.726 INFO ConsoleWriter:22 | resigned bundle DeviceAgent-Runner.app: 'TeamIdentifier=612V32D9TE' => 'TeamIdentifier=612V32D9TE' 2019-08-07 09:32:36.726 INFO ConsoleWriter:22 | Done resigning DeviceAgent-Runner.app with iOS Team Provisioning Profile: . 2019-08-07 09:32:36.770 INFO ConsoleWriter:22 | Checking for profile and app entitlement discrepancy

Please note that : I can visually confirm the DeviceAgent-Runner is installed on the device. The command /gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/bin/iOSDeviceManager install /gems/2.3.0/gems/run_loop-4.3.0/lib/run_loop/device_agent/ipa/DeviceAgent-Runner.app --device-id 00001234-001B64E034D1001E installed the runner with the following output:

Application com.apple.test.DeviceAgent-Runner is not installed on 00001234-001B64E034D1001E Installed com.apple.test.DeviceAgent-Runner version: 1.4.0 / 1565096912 to 00001234-001B64E034D1001E

babakansari commented 4 years ago

@jmoody - The upgrade to run_loop 4.3.0 resolved the issue.

The behaviour was on our own 01_launch.rb file. We had to turn off Wi-Fi on the host mac device.

Thanks for the hints!