Forum Xamarin Test Cloud (Read Only)

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Running UITest on local device

JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

I've got my first UITests running on the iPhone simulator, but also want to test against a physical device (before uploading to the Test Cloud).

However, despite setting my configuration to Debug|MyPhysicalDeviceName, it's still firing up the Simulator.

Any thoughts as to what I'm missing?

Best Answer

Answers

  • RyanThompsonRyanThompson USUniversity ✭✭

    I'm running into this same issue. It always starts in the simulator.

    Furthermore, on the simulator, it seems that no matter which device type I select, it always changes it to an iPhone 5S.

    Can anyone help with this?

  • MalcolmSmithMalcolmSmith USMember

    To change the simulator configuration / device that's launched, you can use the DeviceIdentifier() function on the iOSAppConfigurator.

    Open a terminal window, and run instruments -s. You should get a list of all of your iOS Simulator configurations, like:
    [...] iPad 2 (7.1 Simulator) [4D982BC6-D3D8-4683-99DB-5BE56C8168CA] iPad 2 (8.0 Simulator) [4B637BF8-D09B-4D72-BB06-9B1CBD20AB44] iPad Air (7.1 Simulator) [BAC52EB4-8BF9-4FCE-B825-D1B6A26E863B] iPad Air (8.0 Simulator) [52934579-9D7E-4CB6-8C48-2A9289946684] [...]

    The GUID is the value you should use for DeviceIdentifier. So if you wanted to launch on an iPad 2 simulator for iOS 8, with the example above you would do:
    ConfigureApp.iOS.DeviceIdentifier("4B637BF8-D09B-4D72-BB06-9B1CBD20AB44").AppBundle(PathToIPA).StartApp();

    .
    Similarly if you have a connected iPad / iPhone, I think the ID you see for that device from the 'instruments -s' command is what you're supposed to use for DeviceIdentifier().
    Also, you need to use .InstalledApp(bundleIdentifier) which forces a device run, instead of .AppBundle(ipaPath) which forces a simulator run.
    (However, so far I haven't had luck running tests on a connected iPad. I get an exception when it tries to start the app, or the test runner can't communicate with it (HTTP timeout).)

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @MalcomSmith - Thanks, that's got me a lot further. However, I now get an error saying "Unable to run on a physical device without activation..." and giving details of how to provide my API key.

    I've configured my API key using the ConfigureApp.iOS.ApiKey() method, but I'm still getting this error.

    The API key I'm using is the one I used to submit my app to Test Cloud.

    Thoughts? Can I use this API key for local testing too?

  • i_NateCooki_NateCook USMember ✭✭
    edited October 2014

    Any idea how to set the startup orientation to landscape? app.SetOrientationLandscape() works after the app is started up, but I can't figure out how to start the app in landscape.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    @i_NateCook‌ - that isn't supported at the moment. Sorry.

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    @TomOpgenorth‌ Apologies for the delay in responding. Thanks for the info on the API key. I don't think I've mi-typed it. I'll check and if I'm still having problems I'll let you know.

    James

  • vderfleetvderfleet USMember

    Is there any possibilty to run iOS UITests on a OS X machine but triggered from a tool or IDE on a windows machine? For example its already possible to run an Xamarin iOS app on a OS X machine, builded and triggerd in a IDE like Visual Studio on a windows machine, via bypassing to an OS X machine in the network (see: here)?

    It would be great, if there is a guide, how to trigger iOS UITests on OS X machines in the network, in an IDE like Visual Studio, to run UITest on local iOS devices or the iOS Simulator.

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @vderfleet Running remote iOS UITests from Visual Studio on Windows to a local Mac host is functionality that is not available today.

    You can submit iOS UITests from Visual Studio on Windows to the Xamarin Test Cloud.

Sign In or Register to comment.