Running Xamarin.UITest on an iOS device

Lately I’ve been diving into Xamarin test cloud (which is awesome BTW) using Xamarin.UITest, the c# frontend to Calabash.

Since I’m having some issues deploying our Xamarin.iOS app on a simulator, see http://forums.xamarin.com/discussion/9748/ios-simulator-application-terminated-when-testing-on-older-ios-versions, I tried to get the UI Tests running on an actual device.

It took some digging, but I got it to work using this code:

IApp app = ConfigureApp
                .iOS
                .EnableLocalScreenshots()
                .InstalledApp("com.example.yourappbundleid")
                .DeviceIp("192.168.1.1")
                .StartApp();

As a comparison, the way to run the tests on a simulator is like this:

IApp app = ConfigureApp
                .iOS
                .EnableLocalScreenshots()
                .DeviceIdentifier("E67C54DA-17B2-4EBC-AA08-FBF3FB571243") // iPhone 6, 8.1
                .AppBundle(PathToIPA)
                .StartApp();