Preparing Xamarin.iOS Apps
The section below provides instructions for preparing Xamarin.UITests for upload to App Center Test. Select your platform to begin.
Xamarin.iOS apps must have the Xamarin Test Cloud Agent linked into the app's .ipa file. The Xamarin Test Cloud Agent is a special, embedded HTTP server that allows Xamarin.UITests to interact with the iOS user interface. The Test Cloud Agent is added to the iOS project via NuGet.
Non-Xamarin.iOS apps are also supported by Xamarin.UITest, but instead of the Xamarin Test Cloud Agent require linking Calabash.
Visual Studio for Mac
For an iOS project in Visual Studio for Mac, right click on the Packages folder, select Add Package. Search for Xamarin Test Cloud Agent, and click Add Package:
Visual Studio (Windows)
Xamarin.UITests for iOS apps cannot be executed locally on Windows. You can still create, compile and upload to App Center Test from Windows.
For an iOS project in Visual Studio for Windows, right click on project and select Manage NuGet Packages from the context menu. In the NuGet Package Manager Search for Xamarin Test Cloud Agent and click OK to install that package:
Initialize the Xamarin Test Cloud Agent
After adding the Xamarin Test Cloud Agent to the iOS project, you must initialize the Xamarin Test Cloud Agent when the iOS app starts. Edit the AppDelegate class and add the following snippet to the
#if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif
Apple will reject your app if you submit an app that includes the Xamarin Test Cloud Agent. The Xamarin Test Cloud Agent is only supported for apps signed with Development Provisioning Profiles. When submitted to App Center Test, IPAs are automatically re-signed with one of our Development Provisioning Profiles if possible.
When you surround the initialization code in the ENABLE_TEST_CLOUD conditional compile statement, the Xamarin linker will leave the Xamarin Test Cloud Agent in builds that use the ENABLE_TEST_CLOUD flag. Normally Debug builds but not Release builds. New Xamarin.iOS apps created in Visual Studio use this approach.
Once a test suite is prepared, next setup a test run to upload and run your tests.