Testing on real device - iOS - app permissions popups issue

otebosotebos PLMember


I've looked for an answer quite long without success - so a new question here.

I've iOS app that needs some privileges (GPS, Push notifications).
When app starts for a first time iOS asks user if they're ok with granting those permissions to application.
I've written some UITests and want to automate running them on locally connected iPhone.

The problem is that I cannot override permissions questions and my tests fails.
I found out that application deployed by IDE (Xamarin Studio) will ask for permissions, but application deployed via UITests will not.
So I tried with .AppBundle(path_to_app) but it says this is only valid for deploying to Simulator.

SetUp : System.Exception : This app bundle is not valid for running on a simulator. To fix this issue please ensure that your target device is a simulator. DTPlatformName is 'iphoneos', not 'iphonesimulator' in the apps Info.plist.

Like it's trying to deploy iPhone app to Simulator. But Target in Xamarin Studio is set to real device.
I tried to add .DeviceIdentifier. When Used with .InstalledApp it was starting up (still asking for permissions).
But when I used DeviceIdentifier and AppBundle there was the same error as above.

My tests works fine on Test Cloud. They work fine on Simulator.
They work fine when I deploy to device manually, start app and approve permissions then run UI tests.

What I cannot achieve is to make UITests override permissions questions on real device.
Anyone made this work?

Last thing is that I found is in documentation for AppBundle method
"Will force a run on simulator"

So I maybe doomed with the task but maybe someone knows a workaround?


Sign In or Register to comment.