question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mobile:installCertificate broken on iOS 12.2 (but fixable)

See original GitHub issue

The problem

iOS 12.2 changed the alerts and UI for installing downloaded certificates. After downloading, now you need to dismiss an alert and open Settings > General > Profile, and install the profile. Then the step of going into Security and trusting the certificate.

We’ll have to automate the settings app differently if ios version >= 12.2

Environment

  • Appium version (or git revision) that exhibits the issue: 1.12.1
  • Last Appium version that did not exhibit the issue (if applicable): unrelated, it’s iOS version
  • Desktop OS/version used to run Appium: MacOS 10.14.4
  • Node.js version (unless using Appium.app|exe): 11.6.0
  • Npm or Yarn package manager: npm
  • Mobile platform/version under test: ios
  • Real device or emulator/simulator: sim
  • Appium CLI or Appium.app|exe: cli

Code To Reproduce Issue [ Good To Have ]

String IOS_APP = "https://github.com/cloudgrey-io/the-app/releases/download/v1.6.1/TheApp-v1.6.1.app.zip";

DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("platformName", "iOS");
        caps.setCapability("platformVersion", "12.2");
        caps.setCapability("deviceName", "iPhone Xs");
        caps.setCapability("automationName", "XCUITest");
        caps.setCapability("app", IOS_APP);

        driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);

        Path certificatePath = Paths.get(System.getProperty("user.home"), ".mitmproxy", "mitmproxy-ca-cert.pem");
        Map<String, Object> args = new HashMap<>();
        byte[] byteContent = Files.readAllBytes(certificatePath);
        args.put("content", Base64.getEncoder().encodeToString(byteContent));
        driver.executeScript("mobile: installCertificate", args);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
imurchiecommented, Apr 16, 2019

Feel free to fix it, then.

0reactions
lock[bot]commented, May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intro to certificate management for Apple devices
Root certificates on iPhone and iPad​​ The user can then trust the certificate on the device by going to Settings > General >...
Read more >
2 proven ways to fix error “Cannot Verify Server Identity” in ...
Cannot Verify Server Identity” is caused by iPhone's and iOS's strict validation of mail server certificates. Here are 2 proven ways to fix...
Read more >
Why won't Safari open that web page?
Open Safari. ... Click “Show Certificate” in the window that opens. Select “ISRG Root X1 Certificate” from the hierarchical list. You must select ......
Read more >
How to Fix Security Certificate Error on Android
The reason the above error appears is that your phone's unable to validate the certificate. This happens when something's wrong with that site's ......
Read more >
When i try to install my certificate in keychain, the error says ...
Still relevant for macOS 12.2 in 2022. Got the same issue when installing Charles Proxy's root certs: developer.apple.com/forums/thread/… – oligofren. Jan ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found