SafariLauncher setup on real iOS device


  • The SafariLauncher native app is built and it can be deployed to real devices (both iPhone and iPad) manually.
  • Starting a new Appium based remote device session the SafariLauncher is uninstalled/reinstalled on the iPhone 6 and 6s Plus real devices (the same process fails on iPad).
  • During the install phase some probably security/provisioning file related iOS error messages are added to the Appium log file which are raised by the real device
  • Safari browser is launched on the real device and the default (hard coded in SafariLauncher) URL is opened.
  • In the Appium log file repeated error messages are raised by the iOS – “Could not find any webviews yet, refreshing/retrying”. This seems to be a false failure because the properly loaded page is visible in the Safari browser on the real device.
  • At test level any test fails because of the failed WebDriver initialization.

Test error:
Initialization method FirstAppium.BeamPoC.TestInit threw exception. System.InvalidOperationException: System.InvalidOperationException: An unknown server-side error occurred while processing the command. Original error: Could not navigate to webview; there are none!.

We haven’t found the exact root cause of this this issue yet. Googling on the internet and analysing the log messages
(Appium, iOs level) the highest probability is that the provisioning file is still not perfect and the missing permissions
block the proper communication between the Appium server and the SafariLauncher(Safari) instance on the real device.

Any feedback/suggestions would be greatly appreciated

Best regards

public class Phone6S : IDriverProvider
    public IWebDriver NewDriver()
        var caps = new DesiredCapabilities();
        caps.SetCapability("deviceName", "iPhone 6s Plus");
        caps.SetCapability("platformVersion", "9.3.2");
        caps.SetCapability("platformName", "iOS");
        caps.SetCapability("autoWebview", true);
        //caps.SetCapability("udid", "XXXXXXX"); set by Appium UI
        var driver = new IOSDriver<IWebElement>(new Uri(""), caps, TimeSpan.FromMinutes(5));
        return driver;

Appium log examples:
2016-05-30 13:28:26:217 - info: [Appium] Welcome to Appium v1.5.2
2016-05-30 13:28:26:223 - info: [Appium] Non-default server args:
2016-05-30 13:28:26:225 - info: [Appium] port: 4725
2016-05-30 13:28:26:225 - info: [Appium] log: ‘/tmp/appium.log’
2016-05-30 13:28:26:226 - info: [Appium] safari: true
2016-05-30 13:28:26:226 - info: [Appium] isolateSimDevice: true
2016-05-30 13:28:26:227 - info: [Appium] debugLogSpacing: true
2016-05-30 13:28:26:228 - info: [Appium] defaultCommandTimeout: 7200
2016-05-30 13:28:26:229 - info: [Appium] platformName: ‘iOS’
2016-05-30 13:28:26:229 - info: [Appium] platformVersion: ‘9.3.2’
2016-05-30 13:28:26:230 - info: [Appium] deviceName: ‘iPhone 6s Plus’
2016-05-30 13:28:26:230 - info: [Appium] browserName: ‘Safari’
2016-05-30 13:28:26:230 - info: [Appium] launchTimeout: 400000
2016-05-30 13:28:26:232 - info: [Appium] udid: ‘f9adefe43f73affff819844075xxx…’
2016-05-30 13:28:26:232 - info: [Appium] fullReset: true
2016-05-30 13:28:26:232 - info: [Appium] nativeInstrumentsLib: true
2016-05-30 13:28:26:234 - info: [Appium] showIOSLog: true
2016-05-30 13:28:45:423 - info: [iOSLog] [IOS_SYSLOG_ROW] May 30 15:28:45 Cortex-iPhone6SPlus-4044 securityd[95] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
2016-05-30 13:28:45:423 - info: [iOSLog] [IOS_SYSLOG_ROW] May 30 15:28:45 Cortex-iPhone6SPlus-4044 securityd[95] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
2016-05-30 13:28:45:425 - info: [iOSLog] [IOS_SYSLOG_ROW] May 30 15:28:45 Cortex-iPhone6SPlus-4044 installd[50] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]

2016-05-30 13:29:05:940 - info: [debug] [iOS] No web frames found.
2016-05-30 13:29:05:944 - warn: [iOS] Could not find any webviews yet, refreshing/retrying
2016-05-30 13:29:06:445 - info: [debug] [iOS] Retrieving contexts and views
2016-05-30 13:29:06:446 - info: [debug] [iOS] Selecting by url: true (expected url: ‘undefined’)
2016-05-30 13:29:06:447 - info: [debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
2016-05-30 13:29:06:448 - info: [debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
2016-05-30 13:29:06:504 - info: [debug] [RemoteDebugger] Page element JSON: []
2016-05-30 13:29:06:504 - info: [debug] [iOS] No web frames found.

I am getting the same thing using Appium 1.6.4(beta) and Xcode 8.2.1…

This post is really stale; I’m hoping that someone has some insights into this issue