46

When using filemerge to solve HG conflict, I got the following error

FileMerge[18002:707] Unable to load platform at path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
Jayson
  • 2,123
  • 3
  • 19
  • 16

5 Answers5

21

I have the same FileMerge warning in Git. When I look inside Xcode's preferences, I can see that neither the iPhoneSimulator nor the iPhoneOS platforms are installed but the directories do exist when I look into "/Applications/Xcode.app/Contents/Developer/Platforms".

I don't develop for iOS, so I deleted both iPhoneOS.platform and iPhoneSimulator.platform and the warning went away.

If you do need those platforms, try to reinstall them properly from Xcode.

nox
  • 471
  • 3
  • 5
  • 1
    I suggest renaming the requisite files initially to see if this fixes the issue. Delete (if at all) when you're sure. – Matt Aug 05 '13 at 15:32
  • 1
    Yep, it works, thank you! The path may differ, though. I my case I had to delete `/Applications/Xcode.app/Contents/Developer/Platforms/iPhone*`. – katspaugh Aug 20 '13 at 13:46
  • 1
    @Matt: I agree that one should be cautious when deleting stuff, especially in Terminal since there is no bin you can go back retrieve stuff from there, unlike in Finder. However, renaming did not work. It just gives the same error message with new names. What you _can_ do is `cd /Applications/Xcode.app/Contents/Developer/Platforms/; sudo mkdir movedIosStuff; sudo mv iPhone* movedIosStuff` – Nagel Oct 20 '13 at 09:47
  • Damn... I accidentally downvoted this answer and upvoted the other one (by iphonemaclover) instead of the other way around, and now I can't undo it. Terribly sorry about that, @nox! – Nagel Oct 20 '13 at 10:02
  • @Nagel: Oh, that's good to know--at any rate, a non-destructive operation. – Matt Oct 21 '13 at 20:11
  • 3
    Thx nox, it works. As @Nagel pointed out no need to delete. It looks like it searches for directories ending in .platform. This works too: `cd /Applications/Xcode.app/Contents/Developer/Platforms/;` `sudo mv iPhoneSimulator.platform iPhoneSimulator.platform_RENAMED-TO-AVOID-FILMERGE_ERROR;` `sudo mv iPhoneOS.platform iPhoneOS.platform_RENAMED-TO-AVOID-FILMERGE_ERROR` – Kayo Apr 28 '14 at 04:18
  • [This other answer to this question](http://stackoverflow.com/a/26827411/286599) worked for me and is less invasive. – peteorpeter Feb 25 '15 at 19:31
10

And I tried converting iPhoneSimulator.platform/Info.plist from binary to xml, confirmed that Filemerge doesn't produce the error anymore. Then I converted it back to binary, and still, Filemerge is fine.

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
$ sudo plutil -convert xml1 Info.plist
$ sudo plutil -convert binary1 Info.plist

Disclaimer: inspired by @user3761183!

Alex Kulinkovich
  • 4,408
  • 15
  • 46
  • 50
Marc
  • 101
  • 1
  • 2
  • This worked for me as well, and is the least invasive option. – peteorpeter Feb 25 '15 at 19:29
  • 4
    In my case, converting the files back to binary restored the error message. Keeping them as XML keeps the message away. – Otto G Mar 06 '15 at 10:02
  • Converting to XML works for me temporarily ( > 1 day for sure), but it always ends up resetting, so I have to do it again at some point down the line. Having done this half-a-dozen times now, I'm looking for a more permanent solution. – piersb Mar 31 '16 at 09:01
  • @piersb A launch daemon that re-converts the plist to XML everyday? ;D – Eric Jul 21 '16 at 17:29
6

I tried converting all *.platform/Info.plist from binary to xml1 and it fixed the problem. Strange ...

Joel
  • 4,732
  • 9
  • 39
  • 54
user3761183
  • 241
  • 3
  • 3
3

i face the same problem following command solved my problem:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
9to5ios
  • 5,319
  • 2
  • 37
  • 65
  • 5
    This did not work for me, I still got the same error message afterwards. What is this command supposed to do? – Nagel Oct 20 '13 at 09:39
  • 2
    This sets the active developer directory. However, the question states that the directory exists, so clearly the developer directory is already set. This command does nothing. – Quantum7 Feb 10 '14 at 16:44
3

There is a simple solution to this issue that worked for me. I merely started up Xcode and created an iOS playground project. Xcode asked me to enable developer mode on the Mac, which I did. I then closed Xcode, deleted the project and the filemerge error was no more.

Running Xcode version 6.2

SheedySheedySheedy
  • 536
  • 1
  • 6
  • 14