18

iPhone simulator doesn't work. Displays error message:

The file “Logs” couldn’t be saved in the folder “Library” because a file with the same name already exists.

When /Logs dir is empty, simulator creates subdir CoreSimulator/[AppID] and dispalys the above message. It's fresh OS X Yosemite, installed on new Mac Mini.

Any idea how to fix this issue ?

Tomasz Slanina
  • 181
  • 2
  • 4

4 Answers4

66

Try to reset the Ios Simulator settings it worked for me!

iOS Simulator -> Reset Content and Settings...

storm
  • 661
  • 4
  • 4
6

Just to make it more clear (In addition to @storm's answer):

enter image description here

Gal
  • 1,582
  • 2
  • 14
  • 30
  • Where is this simulator? Inside Xcode? I am facing the same problem here. Error: ENOENT: no such file or directory, stat '~/Library/Logs/CoreSimulator/2B863330-D5E8-4DB4-B63E-599E290B3845/system.log' [ERROR] An error occurred while running cordova run ios --buildFlag=-UseModernBuildSystem=0 -lc (exit code 1). – Francisco Souza Sep 25 '18 at 12:21
2

I suspect that you manually deleted ~/Library/Logs/CoreSimulator and the error message is because the sim is failing to create the ~/Library/Developer/CoreSimulator/Devices//data/Library/Logs symlink because it already exists.

You should be able to get out of this situation by resetting the device by running 'xcrun simctl erase [udid]'

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
2

I solved this (Xcode 7.1) with:

find ~/Library/Developer/XCPGDevices -name Logs* -exec rm -fr {} \;
Luis
  • 21
  • 1