How to handle the pop up during iOS driver initialization

Hello all,

I have a native iOS application to test and I plan to use Appium and iOS simulator to run tests on mac os. (More specifically, I used simulated iPhone 6 device)

When the application launches, it has two pop ups show.

First pop up message will ask if user allow the application to access your location even when you are not using the app (this is a geo location sensitive application), once user click “Allow”,

Second pop up message shows : application would like to send you notifications which may include alerts, sounds. These can be configured in settings

this is part of the pop up when iOS driver is initiated as below:

driver = new IOSDriver(localAppiumServerURL,capabilities);

so the test execution is hanging at above line, unless I manually click ok on these pop ups. By doing this, the driver will be initiated successfully, and test will keep on going for the rest of the screens.

is there a way to configure the iOS simulator to accept these conditions in the settings? I am not able to find anything.

Please help