As you note, the model file is just XML, and for Xcode 4.0+ the format is easy to read and reverse engineer. There's nothing magic about creating one in Xcode, and no reason not to do it outside of Xcode if you can get the syntax right.
A couple of things to keep in mind:
- You probably want to generate a
xcdatamodeld
that can contain multiple versions, even if you only have one version so far. It'll be better for long term maintenance. - You can verify that you have a valid model file at the command line using
xcrun momc $FILE
, which is the command-line version of having Xcode compile it. - If you update your generated model file, Xcode may not notice the change, so you might need to clean and build after model updates.