Bug 35421 - UITests do not work on iOS with Forms: "does not seem to be properly linked with Calabash"
Summary: UITests do not work on iOS with Forms: "does not seem to be properly linked w...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.4 (iOS 9.2)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-10-30 16:11 UTC by calvin.fisher
Modified: 2016-03-14 21:23 UTC (History)
5 users (show)

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

Demo project that fails when trying to run test (147.22 KB, application/x-zip-compressed)
2015-10-30 16:11 UTC, calvin.fisher

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 calvin.fisher 2015-10-30 16:11:46 UTC
Created attachment 13593 [details]
Demo project that fails when trying to run test

We have been trying to get iOS UITests working for our Forms app, but we always get the following error:

    SetUp : System.Exception : The app bundle in [path].app does not seem to be properly linked with Calabash. Please verify that it includes the Calabash component.

I even tried setting up a new project from scratch, using the documentation provided here:
But even in a brand new project with a brand new app, I get the same error.

The zipped project is attached.

- Xamarin Test Cloud Agent component is referenced in the iOS project
- Application.Main is calling Calabash.Start()
- UITest project references and correctly finds the .app output

All the documentation indicates that this should be sufficient for getting testing to work.
Comment 1 Ashley Gazich [MSFT] 2015-11-04 16:03:14 UTC

Please try putting Xamarin.Calabash.Start() into the AppDelegate.FinishedLaunching method. Just in case you haven't seen it yet, here's our guide to adding support in Forms apps: https://developer.xamarin.com/guides/cross-platform/xamarin-forms/uitest-and-test-cloud/#Adding_Support_in_Xamarin.Forms_Apps. 

Please let me know if you continue having any difficulties. Thanks!
Comment 2 calvin.fisher 2015-11-05 15:13:24 UTC
I moved Xamarin.Calabash.Start() from Application.Main into AppDelegate.FinishedLaunching, cleaned, and rebuilt all projects.  Same result.
Comment 3 Ashley Gazich [MSFT] 2015-11-12 12:10:13 UTC
For record-keeping, G. Wilson is working on this via http://forums.xamarin.com/discussion/comment/164388/#Comment_164388.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-12-03 15:16:26 UTC
This happens because when a project is built for both 32-bit and 64-bit simulator, we don't build a fully functional app that can be installed as-is, instead we build something that at launch time (when we know if we'll be launching in a 32-bit or 64-bit simulator) we tweak to become a fully functional app (for the corresponding simulator).

The workaround is to build for a single architecture in your app (you can select it in the iOS Build options for the project).
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-12-03 15:28:16 UTC
I've filed an issue with the corresponding team to get a better error message in the future (it'll tell you to select a single architecture in the project).
Comment 6 calvin.fisher 2015-12-23 17:48:09 UTC
Thanks Rolf, I can confirm that the selecting-a-single-architecture workaround resolved it for us.  A better error message would probably suffice to lead people on the right path in the future.
Comment 7 Rolf Bjarne Kvinge [MSFT] 2015-12-23 18:24:46 UTC
@Calvin, the UITest team has already fixed the issue I reported, and in the future you'll get an error message asking you to select a single architecture.