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.

Appium not creating new Simulator since v1.10.0

See original GitHub issue

The problem

When running iOS tests, Appium no longer creates new Simulators.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.10.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.9.1
  • Node.js version (unless using Appium.app|exe): 11.5.0
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: CLI

Details

We were previously using v1.9.1. We would used desired capabilities as follows for iOS tests:

{
	"platformName": "ios",
	"version": "11.4",
	"platformVersion": "11.4",
	"browserName": "iPhone 8",
	"deviceName": "iPhone 8"
}

Note: browserName and version caps are required as we’re running on a grid.

When running tests, Appium would create a new Simulator named something like appiumTest-iPhone 8 and then delete it after the run. I can see this happening in the logs:

[debug] [simctl] Creating simulator with name 'appiumTest-iPhone 8', device type id 'iPhone 8' and runtime id '11.4'
[iOSSim] Constructing iOS simulator for Xcode version 10.1 with udid '2BF4D537-CAF7-40C2-A19A-C9E56A59B645'
[XCUITest] Created simulator with udid '2BF4D537-CAF7-40C2-A19A-C9E56A59B645'.

and deletion:

[iOSSim] Cleaning simulator 2BF4D537-CAF7-40C2-A19A-C9E56A59B645
[debug] [BaseDriver] Event 'resetComplete' logged at 1547725730425 (11:48:50 GMT+0000 (Greenwich Mean Time))
[debug] [XCUITest] Deleting simulator created for this run (udid: '2BF4D537-CAF7-40C2-A19A-C9E56A59B645')

This is useful for parallel tests where a single Appium server could create multiple instances of the same spec Simulator and we could for example split 80 tests over 4 iPhone 8 11.4 Simulators.

Having upgraded to 1.10.0, this no longer seems to work. Appium just uses whichever Simulator already exists that matches the device name and version and just cleans it after rather than deleting:

[iOSSim] Constructing iOS simulator for Xcode version 10.1 with udid '0D1BB17E-B4EA-47E6-A4EC-F04EEDAD1EED'
[XCUITest] Determining device to run tests on: udid: '0D1BB17E-B4EA-47E6-A4EC-F04EEDAD1EED', real device: false

The downside of this is that if we try to run tests in parallel (either with single or multiple Appium servers) then the tests conflict with each other and fail as they’re trying to use the same Simulator.

If I remove the platformVersion capability and leave version there then it looks like the functionality is still somewhat there but fails on the missing capability and Appium logs print an error:

[XCUITest] Simulator udid not provided, using desired caps to create a new simulator
[debug] [simctl] Creating simulator with name 'appiumTest-iPhone 8', device type id 'iPhone 8' and runtime id 'null'
[simctl] Error: simctl error running 'create': Invalid runtime: null

It looks like the workaround for this is to manually create multiple Simulators, run multiple Appium nodes and pass a unique udid with the default-capabilities flag when starting each node, with each node controlling a different Simulator. This is a lot more messing around though. Is this an intentional change?

Link to Appium logs

https://gist.github.com/marcjones/23aec7e30ea91a9561622874bb824b72

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marcjonescommented, Apr 30, 2019

Finally got to testing this again. The new capability does work now, so thank you for that 👍

I did come across scenarios where it does not currently work though and that appears to be due to Xcode changes. Basically Appium is not able to create a simulators for iOS 12.2. I think this will be resolved by an update to the latest version of node-simctl following this change: https://github.com/appium/node-simctl/pull/81

0reactions
imurchiecommented, Mar 6, 2019

@akifhazarvi This has nothing to do with the issue at hand. Please create a new issue with all the pertinent information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bad app appium ios after updating to v1.10.0 - Issues/Bugs
Hi , After updating to appium version 1.10.0 i am getting the following error : [MJSONWP] Calling AppiumDriver.
Read more >
Cannot start driver on iOS simulator - Support - Appium Discuss
Platform: iOS; Appium version: 1.9.0; Emulator: XCode iPhone Simulator; Client langauage: Java; OS: OSX. I could not start driver, without error message.
Read more >
Unable to start session from appium inspector - Issues/Bugs
I am getting error message when I try to start the session in Appium inspector: "Could not connect to server; are you sure...
Read more >
Appium not utilising the already opened iOS simulator
Issue Hi Team, I am trying to run the iOS tests on already opened simulator (same capabilities as provided in the test -...
Read more >
Appium Is not working after xcode11 update - Issues/Bugs
Good Day, I updated xcode to 11 from 10 and after that i faced a strange issue, ... [info] e[35m[Appium]e[39m Appium v1.12.1 creating...
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