Running Appium deletes the iOS simulators created in Xcode

Mac OSX Mavericks
Appium.app 1.3.3
Xcode 6.1

PROBLEM: Whenever Appium physically launches the simulator all of my iOS simulator devices are deleted, except the iOS sim described in desired_caps (the sim Appium physically launches)

  • Open Xcode
  • Observe I only have iPhone6 iOS8.1 simulator available to run my project on
  • Click Window > Devices and observe I only I only have iPhone6 iOS8.1 available, all of my other devices are missing
  • Manually create one or more additional devices, such as iPhone 4S iOS7.1
  • Can successfully launch my app on the newly created sims directly from Xcode without any problem
  • Can exit / restart Xcode, and all of the sims are still physically present, still no issues
  • Open Appium.app with iPhone 6 iOS8.1 with prelaunch enabled
  • Correct sim is successfully launched
  • Open Xcode and observe all of my other sims have been removed

This appears to be the pertinent details from the Appium.app log:

2014-12-04 15:38:10:198 - info: [debug] Final device string is: ā€˜iPhone 6 (8.1 Simulator)ā€™
2014-12-04 15:38:10:199 - info: [debug] Parsed app Info.plist (as binary)
2014-12-04 15:38:10:217 - info: [debug] Wrote new app Info.plist with device type
2014-12-04 15:38:10:217 - info: [debug] Checking whether we need to set app preferences
2014-12-04 15:38:10:217 - info: [debug] Running ios sim reset flow
2014-12-04 15:38:10:217 - info: [debug] Killing the simulator process
2014-12-04 15:38:10:218 - info: [debug] Killall iOS Simulator
2014-12-04 15:38:10:219 - info: [debug] Killing any other simulator daemons
2014-12-04 15:38:10:244 - info: [debug] Cleaning sim data files
2014-12-04 15:38:10:245 - info: [debug] Executing: xcrun simctl erase 9C0D7887-CCD5-4A1A-BEBA-E079FBE1663E
2014-12-04 15:38:11:153 - info: [debug] Cleaning app data files
2014-12-04 15:38:11:154 - warn: Applications directory /Users/chrigrah/Library/Developer/CoreSimulator/Devices/9C0D7887-CCD5-4A1A-BEBA-E079FBE1663E/data/Applications doesnā€™t exist. Have you run this simulator before?
2014-12-04 15:38:11:154 - info: Couldnā€™t find app directories to delete. Probably itā€™s not installed
2014-12-04 15:38:11:154 - info: [debug] Isolating the requested simulator by deleting all others
2014-12-04 15:38:11:155 - info: [debug] Executing: xcrun simctl list devices
2014-12-04 15:38:11:203 - info: [debug] Executing: xcrun simctl delete 1FA9156F-970F-437D-AF92-9B99AC107D02
2014-12-04 15:38:11:341 - info: [debug] Not setting locale
2014-12-04 15:38:11:341 - info: [debug] No iOS / app preferences to set
2014-12-04 15:38:11:342 - info: [debug] Starting iOS 8.* simulator log capture
2014-12-04 15:38:11:379 - info: [debug] Not pre-launching simulator
2014-12-04 15:38:11:379 - info: [debug] No device id or app, not installing to real device.
2014-12-04 15:38:11:380 - info: [debug] Starting command proxy.
2014-12-04 15:38:11:382 - info: [debug] Instruments socket server started at /tmp/instruments_sock
2014-12-04 15:38:11:382 - info: [debug] Starting instruments
2014-12-04 15:38:11:387 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
2014-12-04 15:38:11:387 - info: Launching instruments
2014-12-04 15:38:11:392 - info: [debug] Attempting to run app on iPhone 6 (8.1 Simulator)

I can reproduce by changing desired_caps to use iPhone 4S iOS7.1 and then Appium will delete my iPhone6 iOS8.1 sim instead.

Iā€™m facing the same issue. Did you ever find a resolution?

My current solution: Only test on a single iPhone6 iOS8.x sim.

At the time I write this I havenā€™t bothered to try other sims at this time, nor real hardware devices.

Thatā€™s too bad. I have OSX Jenkins nodes Iā€™d like to use for both iPad and iPhone sim testing, but switching between the 2 devices is proving to be impossible.

Eventually that will be my plan, too. However, Iā€™m still in the test case design phase and learning / exploring / ironing out general issues with Appium against a single sim has proven a big enough challenge thus far.

I recently started using Appium for iOS.
One of the server arguments ā€œIsolate Simulator Deviceā€ would delete all of the devices in the Core Simulator folder except the one which you are testing (the one provided in the Capabilities). I have been using Appium 1.3.5 and 1.3.6. Seems like the issue is fixed as your devices wouldnā€™t disappear unless you have this argument selected in the Appium app or are providing it while running via node.
You guys may already know this but was just trying to help just in case if some other newbie like myself faces the problem.

Cheers,
Camy

1 Like

Bingo! Thanks for pointing out the obvious for me. :slight_smile:

Thanks. This helped to solve my issue too :+1: