Bug 59188 - Unable to run iOS tests on simulator - Calabash cannot install DeviceAgent
Summary: Unable to run iOS tests on simulator - Calabash cannot install DeviceAgent
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-09-02 00:08 UTC by connorsoohoo
Modified: 2017-09-05 23:49 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description connorsoohoo 2017-09-02 00:08:50 UTC
I can record tests using the Xamarin Test Recorder with the iOS simulator. But when I export the tests to Visual Studio and try to run them, I get that the Device Agent cannot be installed. I've already double checked and the app bundle and device ID in the simulator both match. 


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	<codesign-identity> [OPTIONAL] 	Identity used to codesign app bundle [device only]	DEFAULT=
		-d,--device-id	<device-identifier>	iOS Simulator GUIDs
		-u,--update-app	<true-or-false> [OPTIONAL] 	When true, will reinstall the app if the device contains an older version than the bundle specified	DEFAULT=1
Error installing com.apple.test.DeviceAgent-Runner to 1C9628DC-08F8-44A8-A402-2B072B578009: Error Domain=com.facebook.FBSimulatorControl Code=0 "Simulator does not support any of the architectures ([x86_64, i386]) of the executable at /var/folders/dg/czck705x19x77q0gvcxbdxwm0000gn/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/dg/czck705x19x77q0gvcxbdxwm0000gn/T/xdb/DeviceAgent.iOS.Dependencies/54daf9e58e37a80353a99c2b3139b615/app/DeviceAgent-Runner.app/XCTRunner. Simulator Archs ([(null)])}
Comment 1 Kent Green [MSFT] 2017-09-05 23:49:36 UTC
Even though you might only be hitting this issue locally, we research & triage issues with Xamarin Test Recorder issues through the Test Cloud support channels because there's a lot of crossover between the testing platform, test recorder and testing frameworks. 

You can reach out to support by logging into testcloud.xamarin.com & clicking on "Support" in the menubar: http://content.screencast.com/users/Kent.Green/folders/Jing/media/572442e2-c82c-4a25-9a30-1f594f156dd7/00000323.png

As a quick educated guess on the issue, I'll note that when Test Recorder starts up it is typically set up to inject Calabash which includes the DeviceAgent; when it does this it creates a duplicate of the app in the same location prefixed by xtr, for example:

myApp.app //original file
xtr-myApp.app //app with Calabash injected & resigned by Test Recorder

If all the tools are working normally, you may just need to make sure in Visual Studio for Mac that you are pointing to the "xtr-" copy of the app rather than the original app. If that's not the issue though then please open a support ticket as I mentioned above.