I'm writing a UI Test that is supposed to be cross platform between Android and IOS.
When I run my App Initializer on a Mac, the "platform" Xamarin object always resolves as android (confirmed when running the tests in debug mode) even though I have an iOS simulator open and an iOS device plugged in with no Andorid simulators or devices connected.
public static IApp StartApp(Platform platform)
{
if (platform == Platform.Android)
{
return ConfigureApp
.Android
.ApkFile("../../Binaries/Android/com.xamarin.samples.taskyandroid.apk")
.StartApp();
}
return ConfigureApp
.iOS
.AppBundle("../../Binaries/iOS/TaskyiOS.app")
.DeviceIdentifier("Device id")
.StartApp();
}
The only time I can launch an iOS simulator is when I comment out the if condition without evaluating platform.
How can I get the appinitializer to detect iOS as the platform?
Thanks for your thoughts.
Ensure that you are running your tests for the desired OS, from the
Unit Tests
(XS) orTest Explorer
(VS) windowXamarin Studio
>>View
>>Pads
>>Unit Tests
Visual Studio
>>Tests
>>Test Explorer
I beleive
platform
will default to Android if you use thePlay / Run
button, while the UITest project is selected as theStartup Project
, or if you useRun All
(starting with Android since it appears before iOS)(wow, that image is huge, sorry)