UITest.Driver fails to start app iOS 10 - exception message “Sequence contains no matching element”

2

Answers

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @XactiPurchasing Thanks for the feedback.
    @HubertusGrabner @JamesMundy or others seeing "Failed to install DeviceAgent". We think that can possibly occur for more than one reason. beta06 fixes at least one of them. If you are still seeing that let us know.

  • _JamesMundy_JamesMundy GBMember ✭✭
    edited October 2016

    Hi @Glenn.Wilson, I originally thought it wasn't working but after several clean/rebuilds and deleting bin/obj it now works - thanks!

  • HubertusGrabnerHubertusGrabner USMember ✭✭
    edited October 2016

    Hi!
    For me this seems to still not fix my issues. I tried it from a clean workspace and still get the issue. I am using the latest beta and the iOS 10 Simulator with an iPad Retina. The newest Test Cloud Agent is added to the App which is in a different solution than my tests. In my tests I now used the Beta 06

    From what I see I can tell that the is not being installed. I am using .AppBundle to install the app on the device and my tests fail even before the installation happens. The simulator shows just a rotating symbol that goes on even if the tests did already stop.

    Again I have my stack trace:
    SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent
    Stack trace:
    at Calabash.XDB.Core.Services.iOSDeviceAgentService+d__16.MoveNext () [0x00182] in <48e3da902ca149af9e0223b3053da803>:0
    --- End of stack trace from previous location where exception was thrown ---
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x001f7] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00302] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <48e3da902ca149af9e0223b3053da803>:0
    at TheMobileApp.Test.AppInitializer.StartApp (Xamarin.UITest.Platform platform, System.Boolean isAutomaticRun) [0x0007a] in /Users/buildagent/Documents/workspace/Product/Therefore/Connectors/TheMobile/Xamarin/TheMobileApp.Test/TheMobileApp.Test/Base/AppInitializer.cs:40
    at TheMobileApp.Test.MobileTestBase.BeforeEachTest () [0x0000e] in /Users/buildagent/Documents/workspace/Product/Therefore/Connectors/TheMobile/Xamarin/TheMobileApp.Test/TheMobileApp.Test/Base/MobileTestBase.cs:74
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

    Additional Info:

    When changing my approach to .ConnectToApp() instead of StartApp() it works just fine

    Best Regards Hubertus

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @HubertusGrabner Thanks for that feedback. Can you provide the ConfigureApp statement you are using for iOS and are you using IDE Integrations.

    This comment earlier in this post describes IDE Integration:
    http://forums.xamarin.com/discussion/comment/221300/#Comment_221300

  • HubertusGrabnerHubertusGrabner USMember ✭✭
    edited October 2016

    My statement was:
    .iOS
    .EnableLocalScreenshots()
    .DeviceIdentifiert("xxx")
    .AppBundle(@./../MyApp.app)
    .StartApp();

    I also tried the following instead of AppBundle
    .InstalledApp and deployed the app to the device before starting the tests.

    I will look into using the IDE preferences and come back with my results.

    Edit:
    While examining the unit test pad I noticed that this is of no use for me, because the app is not in the same solution as the testing project. So it is not possible for me to use the IDE Integration.

    Best Regards
    Hubertus

  • AnthonyRamirezAnthonyRamirez USUniversity ✭✭✭

    Hi @HubertusGrabner

    You may want to try adding .Debug() to the call list

    IE

    .iOS
    .Debug()
    .EnableLocalScreenshots()
    .DeviceIdentifiert("xxx")
    .AppBundle(@./../MyApp.app)
    .StartApp();

  • HubertusGrabnerHubertusGrabner USMember ✭✭

    Hi!
    I have tried that combination and also a 9.3 Simulator where it does also not work.
    In an earlier post I mentioned that it would work with connect to app, but that was not entirely correct because when I am in repl I can just use tree but no other command without a failure.

    Best Regards
    Hubertus

  • CJensenCJensen USMember ✭✭

    @HubertusGrabner

    Have you got it to work ? .. I'm struggling with the same issues as you and are stuck :(

    Br,
    Christian

  • JGoldbergerJGoldberger USXamarin Team, University Xamurai

    @Glenn.Wilson

    The above 2 links appear to be dead.

  • HubertusGrabnerHubertusGrabner USMember ✭✭
    edited October 2016

    @CJensen @Glenn Wilson
    Not yet at all, I have stopped investigating for a while because I have work to finish aswell. I am going to look into it next week! I got a different call stack now but the error is still "Failed to install Device Agent".

    Edit:
    I can now attach my stack trace, maybe the Xamarin Team can help me finding my issue?

    SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 134
    2016-10-28 08:22:28.993 iOSDeviceManager[4499:64808] CoreSimulator: Loading from /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework
    2016-10-28 08:22:28.998 iOSDeviceManager[4499:64808] CoreSimulator: Successfully loaded
    2016-10-28 08:22:28.998 iOSDeviceManager[4499:64808] CoreSimulator: SimDevice has correct path of /Applications/Xcode.app
    2016-10-28 08:22:28.998 iOSDeviceManager[4499:64808] SimulatorKit: Loading from /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/SimulatorKit.framework
    2016-10-28 08:22:29.000 iOSDeviceManager[4499:64808] SimulatorKit: Successfully loaded
    2016-10-28 08:22:29.000 iOSDeviceManager[4499:64808] SimulatorKit: SimDeviceFramebufferService has correct path of /Applications/Xcode.app
    2016-10-28 08:22:29.000 iOSDeviceManager[4499:64808] Loaded All Private Frameworks [CoreSimulator, SimulatorKit]
    2016-10-28 08:22:29.071 iOSDeviceManager[4499:64808] Completed Pool Preconditons
    2016-10-28 08:22:29.094 iOSDeviceManager[4499:64808] Error creating SimulatorApplication for path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/app/DeviceAgent-Runner.app: Error Domain=com.facebook.FBControlCore Code=0 "Could not obtain Bundle ID for app at path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/app/DeviceAgent-Runner.app" UserInfo={NSLocalizedDescription=Could not obtain Bundle ID for app at path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/app/DeviceAgent-Runner.app}
    2016-10-28 08:22:29.094 iOSDeviceManager[4499:64808] EXEC: /usr/bin/xcrun codesign --verbose=4 --verify /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/93c12f73043a2d14eea9d417ab080eb4/app/DeviceAgent-Runner.app/XCTRunner
    2016-10-28 08:22:33.565 iOSDeviceManager[4499:64808] *** Assertion failure in -[FBSimulator installedApplicationWithBundleID:error:], /Users/chrisf/FBSimulatorControl/FBSimulatorControl/Management/FBSimulator+Helpers.m:126
    2016-10-28 08:22:34.354 iOSDeviceManager[4499:64808] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: bundleID'
    *** First throw call stack:
    (
    0 CoreFoundation 0x00007fff974fb4f2 __exceptionPreprocess + 178
    1 libobjc.A.dylib 0x00007fff8751173c objc_exception_throw + 48
    2 CoreFoundation 0x00007fff975001ca +[NSException raise:format:arguments:] + 106
    3 Foundation 0x00007fff88192856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4 FBSimulatorControl 0x000000010affcc0e -[FBSimulator(Helpers) installedApplicationWithBundleID:error:] + 221
    5 FBSimulatorControl 0x000000010affbf55 -[FBSimulatorApplicationCommands isApplicationInstalledWithBundleID:error:] + 83
    6 iOSDeviceManager 0x000000010ae75aaa +[Simulator appIsInstalled:deviceID:] + 164
    7 iOSDeviceManager 0x000000010ae75332 +[Simulator installApp:deviceID:updateApp:codesignID:] + 515
    8 iOSDeviceManager 0x000000010ae6b66e +[Device installApp:deviceID:updateApp:codesignID:] + 146
    9 iOSDeviceManager 0x000000010ae539be +[InstallAppCommand execute:] + 419
    10 iOSDeviceManager 0x000000010ae70d4a +[CLI process:] + 1171
    11 iOSDeviceManager 0x000000010ae35504 main + 104
    12 libdyld.dylib 0x00007fff936005ad start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

  • I have the same error: SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent.

    Stack trace:
    at Calabash.XDB.Core.Services.iOSDeviceAgentService+d__16.MoveNext () [0x00182] in <48e3da902ca149af9e0223b3053da803>:0
    --- End of stack trace from previous location where exception was thrown ---
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x001f7] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00302] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <48e3da902ca149af9e0223b3053da803>:0
    at Onboarding.UITest.AppInitializer.StartApp (Xamarin.UITest.Platform platform) [0x00038] in /Users/Carolien/Projects/LaatsteKeer/Onboarding.Xamarin/Onboarding.UITest/AppInitializer.cs:28
    at Onboarding.FeatureBase.BeforeEachTest () [0x00007] in /Users/Carolien/Projects/LaatsteKeer/Onboarding.Xamarin/Onboarding.UITest/Features/FeatureBase.cs:26
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

    I am testing on a real device. I've tried on an iPad mini 2 (Model A1489) (iOS 9.3.5) as well as an iPhone 6 (iOS10). Both don't work. The project builds and the Unit Tests find the Target app, but if I run my tests, the app doesn't start. I If I test on an iPhone simulator (iOS 10.0) everything works fine.

    I am using:

    • Xcode 8
    • Xamarin Studio 6.1.1
    • Xamarin.UITest 2.0.0-beta06
  • I have the same error: SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent.

    Stack trace:
    at Calabash.XDB.Core.Services.iOSDeviceAgentService+d__16.MoveNext () [0x00182] in <48e3da902ca149af9e0223b3053da803>:0
    --- End of stack trace from previous location where exception was thrown ---
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x001f7] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00302] in <48e3da902ca149af9e0223b3053da803>:0
    at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <48e3da902ca149af9e0223b3053da803>:0
    at Onboarding.UITest.AppInitializer.StartApp (Xamarin.UITest.Platform platform) [0x00038] in /Users/Carolien/Projects/LaatsteKeer/Onboarding.Xamarin/Onboarding.UITest/AppInitializer.cs:28
    at Onboarding.FeatureBase.BeforeEachTest () [0x00007] in /Users/Carolien/Projects/LaatsteKeer/Onboarding.Xamarin/Onboarding.UITest/Features/FeatureBase.cs:26
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0-c8sr0/bockbuild-mono-4.6.0-branch-c8sr0/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

    I am testing on a real device. I've tried on an iPad mini 2 (Model A1489) (iOS 9.3.5) as well as an iPhone 6 (iOS10). Both don't work. The project builds and the Unit Tests find the Target app, but if I run my tests, the app doesn't start. I If I test on an iPhone simulator (iOS 10.0) everything works fine.

    I am using:

    • Xcode 8
    • Xamarin Studio 6.1.1
    • Xamarin.UITest 2.0.0-beta06
  • AlexeyShikovAlexeyShikov UAMember ✭✭

    Same here. Any luck with it?

  • AlexeyShikovAlexeyShikov UAMember ✭✭

    I have the same issue launching tests on Bitrise. Any news on how to workaround it?

  • dcc-mobiledcc-mobile BEMember ✭✭
    edited November 2016

    Facing a similar issue (but not related to iOS)
    Running on a simulator itself does work fine.

    <package id="Xamarin.UITest" version="2.0.0.1537-dev" targetFramework="net45" /> <package id="Xamarin.TestCloud.Agent" version="0.20.3" targetFramework="xamarinios10" />

    1 - LaunchTestAsync: deviceId: A44E15BE-9206-458B-8C4F-5EFB9E62B8AD 2 - HTTP DELETE http://127.0.0.1:27753/1.0/session 2 - HTTP DELETE complete DeviceAgent delete session response: RequestTimeout - 3 - HTTP POST http://127.0.0.1:27753/1.0/shutdown 3 - HTTP POST complete DeviceAgent shutdown response: RequestTimeout - 4 - HTTP GET http://127.0.0.1:27753/1.0/ping 1 - Launching simulator if not already running Running: /var/folders/k_/qlzt79qn3k93ccp_tyl_wyfm0000gq/T/xdb/DeviceAgent.iOS.Deployment/2f570bceda193bbf44f08e9f8a87b01e/bin/iOSDeviceManager launch_simulator -d A44E15BE-9206-458B-8C4F-5EFB9E62B8AD Exit code '134' received from '/var/folders/k_/qlzt79qn3k93ccp_tyl_wyfm0000gq/T/xdb/DeviceAgent.iOS.Deployment/2f570bceda193bbf44f08e9f8a87b01e/bin/iOSDeviceManager launch_simulator -d A44E15BE-9206-458B-8C4F-5EFB9E62B8AD' dyld: Library not loaded: @rpath/CocoaLumberjack.framework/Versions/A/CocoaLumberjack Referenced from: /var/folders/k_/qlzt79qn3k93ccp_tyl_wyfm0000gq/T/xdb/DeviceAgent.iOS.Deployment/2f570bceda193bbf44f08e9f8a87b01e/bin/iOSDeviceManager Reason: image not found 1 - Unsuccessful

  • SteveMacdonaldSteveMacdonald CAUniversity, Certified XTC Partners ✭✭

    2.0.0.1547-dev fixed this for me. Tested on iOS 9 hardware so far.

  • HubertusGrabnerHubertusGrabner USMember ✭✭

    Hi!

    This issue has not been fixed on my side!

    Has anyone else any idea what could be wrong?

    Best Regards
    Hubertus

  • DidsDids FIMember ✭✭

    Same issue here. Runs fine locally, but not in Bitrise.

  • HubertusGrabnerHubertusGrabner USMember ✭✭

    @BrandonMinnick
    Hi Brandon!
    Thanks for putting your infos here, sadly this procedure could not fix my issues. I have tried it again with the latest Xcode Version and the latest UITest version and my issues still persists even after cleaning the xdb folder.

    Have you any other suggestions about my issue?

    Here is the stack trace from my latests try:
    SetUp : System.Exception : Test Initialize failed!
    ----> Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 134
    0 CoreFoundation 0x00007fff9ae5b4f2 __exceptionPreprocess + 178
    1 libobjc.A.dylib 0x00007fff8bb3773c objc_exception_throw + 48
    10 iOSDeviceManager 0x00000001057dac0c +[CLI process:] + 1142
    11 iOSDeviceManager 0x00000001057ae5ed main + 121
    12 libdyld.dylib 0x00007fff978045ad start + 1
    2 CoreFoundation 0x00007fff9ae601ca +[NSException raise:format:arguments:] + 106
    3 Foundation 0x00007fff8c8d7856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4 FBSimulatorControl 0x00000001059c136f -[FBSimulator(Helpers) installedApplicationWithBundleID:error:] + 221
    5 FBSimulatorControl 0x00000001059c06b6 -[FBSimulatorApplicationCommands isApplicationInstalledWithBundleID:error:] + 83
    6 iOSDeviceManager 0x00000001057e0150 +[Simulator appIsInstalled:deviceID:] + 164
    7 iOSDeviceManager 0x00000001057df834 +[Simulator installApp:deviceID:updateApp:codesignID:] + 606
    8 iOSDeviceManager 0x00000001057d6f91 +[Device installApp:deviceID:updateApp:codesignID:] + 146
    9 iOSDeviceManager 0x00000001057c05ec +[InstallAppCommand execute:] + 419
    (
    )
    *** First throw call stack:
    2016-12-20 08:49:17.966 iOSDeviceManager[1082:31727] *** Assertion failure in -[FBSimulator installedApplicationWithBundleID:error:], /Users/moody/git/calabash/FBSimulatorControl/FBSimulatorControl/Management/FBSimulator+Helpers.m:126
    2016-12-20 08:49:17.968 iOSDeviceManager[1082:31727] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: bundleID'
    Error creating SimulatorApplication for path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app: Error Domain=com.facebook.FBControlCore Code=0 "Could not obtain Bundle ID for app at path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app" UserInfo={NSLocalizedDescription=Could not obtain Bundle ID for app at path /var/folders/s9/bljw34rd6dqcy0w46xssrvrw0000gp/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app}
    libc++abi.dylib: terminating with uncaught exception of type NSException

    Stack Trace:
    at TheMobileApp.Test.MobileTestBase.BeforeEachTest () [0x002d8] in /Users/buildagent/Documents/workspace/Product/Therefore/Connectors/TheMobile/Xamarin/TheMobileApp.Test/TheMobileApp.Test/Base/MobileTestBase.cs:209
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.6.0/bockbuild-mono-4.6.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
    --DeviceAgentException
    at Calabash.XDB.Core.Services.iOSDeviceAgentService.WithErrorHandling (System.Int32 eventId, System.Func`1[TResult] action, System.String errorMessage, System.Int32[] successCodes) [0x000b8] in :0
    at Calabash.XDB.Core.Services.iOSDeviceAgentService+d__16.MoveNext () [0x0016a] in :0
    --- End of stack trace from previous location where exception was thrown ---
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x0020a] in :0
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in :0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00302] in :0
    at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in :0
    at TheMobileApp.Test.AppInitializer.StartApp (Xamarin.UITest.Platform platform, System.Boolean isAutomaticRun) [0x0007f] in /Users/buildagent/Documents/workspace/Product/Therefore/Connectors/TheMobile/Xamarin/TheMobileApp.Test/TheMobileApp.Test/Base/AppInitializer.cs:37
    at TheMobileApp.Test.MobileTestBase.BeforeEachTest () [0x0000f] in /Users/buildagent/Documents/workspace/Product/Therefore/Connectors/TheMobile/Xamarin/TheMobileApp.Test/TheMobileApp.Test/Base/MobileTestBase.cs:153

  • NickMartinNickMartin USMember

    I am getting the same thing as tuyenv. This started today after updating to xcode 8.3, which a clean install of Visual Studio 2017 required me to do today in order to build the solution from my Windows machine. It seems there was an update to Xamarin that is insisting on xcode 8.3 but calabash UI tests do not support it?

    We are on Xamarin.UITest 2.0.7. I also tried the latest pre-release version (Xamarin.UITest 2.0.7.1616-dev) with no luck.

    Need help!!!!!

  • RunarOvesenHjerpbakkRunarOvesenHjerpbakk NOUniversity ✭✭

    I have the same issue as @tuyenv and @NickMartin . Anybody have any advice for us?

  • NickMartinNickMartin USMember

    @tuyenv, @RunarOvesenHjerpbakk and anyone else dealing with this latest issue, I reached out to Microsoft about this and they confirmed this is an issue introduced with Xcode 8.3, the upgrade of which was prompted with the most recent VS 2017 release. They say Xcode 8.3 is not supported by UITest/Calabash at this time. Their recommendation is "investigate rolling back your stack and/or running a side-by-side setup for your testing workflow".

    We are just relying on Xamarin Test Cloud for the time being, though we aren't thrilled about the slower feedback loop. They said this is a high priority issue and are actively working on a resolution...

  • KyleKurzKyleKurz USMember

    This is incredibly frustrating. "Rolling back your stack" is not an option for iOS. Needs fixed by Microsoft/Xamarin teams!

  • WD40WD40 USMember ✭✭

    +1, also hitting this with Xcode 8.3

  • CloudWindMoonSunCloudWindMoonSun USMember ✭✭

    Rolling back didn't help me either. Really stuck. Cannot wait for a fix

  • KyleKurzKyleKurz USMember
    edited April 7

    And now today, the stable channel REQUIRES Xcode 8.3...

    EDIT: Looks like I had build artifacts from Alpha channel switch. Still broken in Alpha though.

  • AlexanderBoffinAlexanderBoffin USMember

    I got a similar problem after updating xcode. When rerunning the iOS tests locally I got as error:
    "
    SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent
    ExitCode: 5
    -a,--app-bundle <path/to/app-bundle.app> Path .app bundle (for .ipas, unzip and look inside of 'Payload')
    -c,--codesign-identity [OPTIONAL] Identity used to codesign app bundle [device only] DEFAULT=
    -d,--device-id iOS Simulator GUIDs
    -u,--update-app [OPTIONAL] When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
    install
    Error installing com.apple.test.DeviceAgent-Runner to E01584BD-6771-4E7D-8F5E-C9046996E075: Error Domain=com.facebook.FBSimulatorControl Code=0 "Simulator does not support any of the architectures ([x86_64, i386]) of the executable at /var/folders/45/9nx13fb514gcqhsjf1bvypkm0000gn/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app/XCTRunner. Simulator Archs ([(null)])" UserInfo={NSLocalizedDescription=Simulator does not support any of the architectures ([x86_64, i386]) of the executable at /var/folders/45/9nx13fb514gcqhsjf1bvypkm0000gn/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app/XCTRunner. Simulator Archs ([(null)])}
    false
    "

    I solved this by updating my Xamatin.UITest to the latest version (now 2.0.8). Then the tests ran again on the emulators.

  • shivanandamsshivanandams INMember
    edited May 15

    I am successfully executed iOS scripts on Local and cloud OS 9+ and 10+ devices with below configuration

    1. Xcode Version - 8.2.1
    2. Xamarin test cloud agent Version - 0.20.3 (Dev team should add this package)
    3. Xamarin.UITest version: 2.0.9
    4. NUnit - 2.6.4
    5. Local Devices version - 10+ & 9+ (executed successfully)
    6. Cloud Device version - 10+ & 9+ (executed successfully)
    7. Dev certificate
    8. Dev Profile

    Note :

    Install dev certificate to your system and make sure your device UDID added in the profile.
    Dev team should use same profile to build and release iOS app.

    When you execute the scripts, first device agent is install to your local device and app will launch next.

  • EmrahDautbegovicEmrahDautbegovic USMember ✭✭

    @Glenn.Wilson
    Hi Glenn,
    I used UITest 2.0.8 for 2-3 months and everything was fine. Two days ago I tried to run tests locally on iOS device and it just could not install Device Agent on the device. I tried to update UITest to 2.0.9 but it did not help me.
    I found out that when I turn off my Mac and try again it works but just once. Every next time if fails. Also, I realized that when I don't interrupt test run until it is finished I can run tests again. Once I interrupted tests run, I have to turn off Mac if I want to run them again. What do you propose me to do? Thanks in advance. Emrah

  • mateuszcwiklamateuszcwikla USMember ✭✭
    edited June 29

    Hello all, this is my first post - so just wanted to let you know that I will probably be a bit active here in near future.
    So what I have...
    Xamarin.Forms app for both iOS and Droid.
    Using UITests to do some automation.

    I've got latest v 2.0.9
    I've got XCode 8.3.3
    NUnit is 2.6.3

    and I want to run a simplest test
    [Test]
    public void AppLaunches()
    {
    App.Repl();
    App.Screenshot("First screen.");
    }

    on iOS local Simulator (I've tried iPhone 7 with 10.3.1 and iPhone 6 S Plus with 9.0 iOS versions) but always get the same error after few seconds when the App starts
    SetUp : System.Exception : Unable to contact test backend running in app. A common cause is that the app is not properly linked with Calabash. Please verify that it includes the Calabash component.

    My config in AppInitilizer:
    ** return ConfigureApp
    .iOS
    .Debug()
    .AppBundle(IosLocation)
    .DeviceIdentifier("XXX") //iPhone 6s Plus 9.0
    .EnableLocalScreenshots()
    .LogDirectory(TestLogsLocation)
    .StartApp();_
    **

    Some more info:
    -Can you launch your app manually on the same device or simulator and interact with it?
    Yes I can, the simulator works if its run by itself, also Android test is Passing.

    -I am using Visual Studio for Mac 7.0.1 (build 24) and work on MacOSX

    I did as described here: https://developer.xamarin.com/guides/testcloud/uitest/adding-uitest/#Adding_the_Xamarin_Test_Cloud_Agent_to_the_iOS_Project

    EDIT:
    ok... got it running,
    please make it more clear in your documentation
    the solution from SJ-87 from below thread helped:

    https://forums.xamarin.com/discussion/70779/xamarin-uitest-system-exception-unable-to-contact-test-backend-running-in-app

    Also another thing, when adding new project for UITests there is comment in AppInitilizer.cs

    to add
    if TEST_CLOUD
    Xamarin.Calabash.Start();
    endif

    and in documentation it is
    if ENABLE_TEST_CLOUD

    I dont know if the first one is depreciated but please fix it also :)

  • mateuszcwiklamateuszcwikla USMember ✭✭

    Ok - sorry for answering by myself but I've got it working:
    so 2 things:
    first - it should be "ENABLE_TEST_CLOUD"
    second - found in another topic on the forum -> Debug build should have added in Compiler section options:
    "ENABLE_TEST_CLOUD"

  • fingradfingradfingradfingrad USMember

    SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 5

        -c,--codesign-identity  <codesign-identifier> [OPTIONAL]    Identity used to codesign app bundle [device only]. Deprecated - should use profile path.   DEFAULT=
        -d,--device-id  <device-identifier> iOS Simulator GUID or 40-digit physical device ID
        -i,--resources-path <path/to/resources> [OPTIONAL]  Path to resources (executables) to inject into app directory. A list of colon separated files may be specified.
        -p,--profile-path   <profile-path> [OPTIONAL]   Path to provisioning profile
        -u,--update-app <should-update-app> [OPTIONAL]  When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
    install <app-path>
    

    Checking for profile and app entitlement discrepancy
    Error installing application: Error Domain=com.facebook.FBDeviceControl Code=0 "Failed to install application with path /var/folders/9k/77jtn84x6pg79gp0l4m54xm00000gn/T/xdb/DeviceAgent.iOS.Dependencies/2450a6b29680a9ad62e5bb5816848ba8/ipa/DeviceAgent-Runner.app" UserInfo={NSLocalizedDescription=Failed to install application with path /var/folders/9k/77jtn84x6pg79gp0l4m54xm00000gn/T/xdb/DeviceAgent.iOS.Dependencies/2450a6b29680a9ad62e5bb5816848ba8/ipa/DeviceAgent-Runner.app, NSUnderlyingError=0x7ff75466b880 {Error Domain=com.facebook.FBDeviceControl Code=0 "Failed to install application" UserInfo={NSLocalizedDescription=Failed to install application}}}

    It seems that Xamarin doesn't have any support or developer team at all.

  • fingradfingradfingradfingrad USMember

    SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 5

        -c,--codesign-identity  <codesign-identifier> [OPTIONAL]    Identity used to codesign app bundle [device only]. Deprecated - should use profile path.   DEFAULT=
        -d,--device-id  <device-identifier> iOS Simulator GUID or 40-digit physical device ID
        -i,--resources-path <path/to/resources> [OPTIONAL]  Path to resources (executables) to inject into app directory. A list of colon separated files may be specified.
        -p,--profile-path   <profile-path> [OPTIONAL]   Path to provisioning profile
        -u,--update-app <should-update-app> [OPTIONAL]  When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
    install <app-path>
    

    Checking for profile and app entitlement discrepancy
    Error installing application: Error Domain=com.facebook.FBDeviceControl Code=0 "Failed to install application with path /var/folders/9k/77jtn84x6pg79gp0l4m54xm00000gn/T/xdb/DeviceAgent.iOS.Dependencies/2450a6b29680a9ad62e5bb5816848ba8/ipa/DeviceAgent-Runner.app" UserInfo={NSLocalizedDescription=Failed to install application with path /var/folders/9k/77jtn84x6pg79gp0l4m54xm00000gn/T/xdb/DeviceAgent.iOS.Dependencies/2450a6b29680a9ad62e5bb5816848ba8/ipa/DeviceAgent-Runner.app, NSUnderlyingError=0x7ff75466b880 {Error Domain=com.facebook.FBDeviceControl Code=0 "Failed to install application" UserInfo={NSLocalizedDescription=Failed to install application}}}

    It seems that Xamarin does not have any support or developer team at all. Bugs do not fix for years

  • SergiuCosminSergiuCosmin USMember ✭✭

    hello,

    I am facing a similar issue, until last week everything worked fine, now I can't get the UITest to work on iOS

    I am using it like so:

    ConfigureApp
    .iOS
    .DeviceIdentifier("ID_of_device_here")
    .InstalledApp("app_name_here")
    .StartApp();

    Xamarin

    "SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 8

        -c,--codesign-identity  <codesign-identifier> [OPTIONAL]    Identity used to codesign app bundle [device only]. Deprecated - should use profile path.   DEFAULT=
        -d,--device-id  <device-identifier> iOS Simulator GUID or 40-digit physical device ID
        -i,--resources-path <resources-path> [OPTIONAL]     Path to resources (executables) to inject into app directory. A list of colon separated files may be specified.
        -p,--profile-path   <profile-path> [OPTIONAL]   Path to provisioning profile
        -u,--update-app <should-update-app> [OPTIONAL]  When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
    install <app-path>
    

    2017-11-06 18:01:20.075 iOSDeviceManager[63701:7951527] [MT] DVTPlugInManager: Required plug-in compatibility UUID C3998872-68CC-42C2-847C-B44D96AB2691 for MobileDevice.framework (com.apple.mobiledevice) not present
    Error getting device with ID ce7202fddf379cc07f85801fe9b87967f02d9980: Error Domain=com.facebook.FBControlCore Code=0 "Failed to load device console entries" UserInfo={NSLocalizedDescription=Failed to load device console entries}

    at Xamarin.UITest.XDB.Services.iOSDeviceAgentService.WithErrorHandling (System.Int32 eventId, System.Func`1[TResult] action, System.String errorMessage, System.Int32[] successCodes) [0x000c1] in <28f5a11e585645768f72d972a14f76dc>:0
    at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+c__async6.MoveNext () [0x002c7] in <28f5a11e585645768f72d972a14f76dc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x0020a] in <28f5a11e585645768f72d972a14f76dc>:0
    at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in <28f5a11e585645768f72d972a14f76dc>:0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Execution.IExecutor executor) [0x002de] in <28f5a11e585645768f72d972a14f76dc>:0
    at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00000] in <28f5a11e585645768f72d972a14f76dc>:0
    at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <28f5a11e585645768f72d972a14f76dc>:0
    at Miele.Settings.UITests.AppInitializer.StartApp (Xamarin.UITest.Platform platform, System.Boolean isSimulator) [0x000b7] in /Users/rocosm/Projects/Work/GitLab/MieleAtMobile/tests/clients/Miele.Settings.UITests/AppInitializer.cs:50
    at Miele.Settings.UITests.Views.UserAccountViewTests.BeforeEachTest () [0x00001] in /Users/rocosm/Projects/Work/GitLab/MieleAtMobile/tests/clients/Miele.Settings.UITests/Views/UserAccountViewTests.cs:43
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 "

  • smrof_niramaxsmrof_niramax USMember ✭✭

    I'm also facing the same issue as SergiuCosmin:

    DeviceAgentException : Failed to install DeviceAgent

    ExitCode: 8

  • JoshuaLogueJoshuaLogue USUniversity

    Also seeing this issue seeing ExitCode: 8

    Just upgraded to Xcode 9.1
    Visual studio fo mac 7.2.2
    Nunit 2.6.4
    Xamarin.UITest 2.2.0
    TestCloud.Agent 0.21.2
    Xamarin.iOS 11.3.0.47

    Is anyone looking at this issue?

  • smrof_niramaxsmrof_niramax USMember ✭✭

    It's fixed in Xamarin.UITest 2.2.1

2
Sign In or Register to comment.