Remove Realm Model Object from Xcode

Xcode keeps it's custom templates at

~/Library/Developer/Xcode/Templates

Folders are “groups” within Xcode.

If you navigate to that folder, (ensuring XCode is not running) you can simple drag the Realm folder to the trash.

Edit

After much discussion, there may be files located at the following paths as well that can be removed (with XCode Closed)

~/Library/Application Support/Realm/rlm_lldb.py

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/RealmPlugin.xcplugin

Then I had to clean and run once - which crashed. But then clean and ran a second time which worked, and has been working for a couple of weeks with no side effects. Please post a comment if you have a different experience.

IMPORTANT EDIT

Finally found the root cause which is still related to the plug in, and want to put all of the info in one place. There are two options;

1) If you want to continue to use the plug in which installs Realm Object template that can be used when creating new objects as well as add support for inspecting the property values of persisted RLMObjects in the debugger pane. Download the newest updated project from here

https://github.com/realm/realm-cocoa

which has a folder called plugin with info for installing the plug in. I've installed it and that seems to correct the error outlined in the question which is related to this error

2) Otherwise, if you want to remove the plug in entirely, the old template installer modifies a hidden file located at

~/.lldbinit

you can see it by going to the command line, navigating to your home folder

cd..

and then showing hidden files

ls -a

The .lldbinit in your home directory is sourced in BEFORE the target you are going to debug is created. It's purpose is to set up the environment for creating that target.

from this answer.

So that file will contain this line

command script import "~/Library/Application Support/Realm/rlm_lldb.py" --allow-reload

which will try to set up your XCode environment with the rlm_lldb.py file.

If you're not using the plug in and have removed the other files per above, you can further remove references to it by editing the ~/.lldbinit file.

If you are familiar with the pico editor you can edit the file with

pico .lldb

and either comment the line with a # or just delete the line entirely.

Credit goes to the answer by @sahm to this question


The rest of the Realm plugin can be disabled by editing ~/.lldbinit and removing or commenting out this line:

command script import "~/Library/Application Support/Realm/rlm_lldb.py" --allow-reload

add a # to comment it:

#command script import "~/Library/Application Support/Realm/rlm_lldb.py" --allow-reload

Tags:

Xcode

Realm