Python sample code does not work with appium 1.6.4-beta and XCode 8.2.1 on real iOS 10.2

I have 2 issues here.

The first, seems like a regression here.

The code is from : sample-code/sample-code/examples/python/ios_webview.py at master · appium-boneyard/sample-code · GitHub

I added:
‘platformVersion’: ‘10.2’,
‘automationName’: ‘XCUITest’

to the capabilities.

The code sample which fails:
def test_get_url(self):

  url_el = self.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[1]/UIATextField[1]')

Exception : NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

The app seems to open but is not accessible.

Any ideas how to get this to work?

Also geturl seems to fail with:
selenium.common.exceptions.WebDriverException: Message: Unhandled endpoint: /session/307CEA1C-2714-4837-8003-083D28231BED/url – http://localhost:8100/ with parameters {
wildcards = (
“session/307CEA1C-2714-4837-8003-083D28231BED/url”
);
}

NB:
Is there a way to use the SafariDriver instead? I did not find any documentation on how to use that with appium 1.6 and iOS 10+ devices.