Open your React Native’s Xcode project file from the CLI with xed

For a long time I always used the open command to open the Xcode project file contained inside React Native Projects.

bramus in ~/repos/projects/react-native/example
$ open ios/Example.xcodeproj

It wasn’t until I recently started a new React Native project that react-native init afterwards informed me to use xed instead.

The xed tool launches the Xcode application and opens the given documents, or opens a new untitled document, optionally with the contents of standard in.

With xed you don’t need to know the name of the project file. Just pass in the ios folder as an argument and it will handle things for you:

bramus in ~/repos/projects/react-native/example
$ xed ios

💁‍♂️ xed handles both workspaces (.xcworkspace) and regular project files (.xcodeproj) so no worries there 🙂

Furthermore, if you don’t want to remember yet another extra command, you can always add it as a script to your package.json:

{
	…
	"scripts": {
		…
		"xcode": "xed ios"
	},
	…
}
Did this help you out? Like what you see?
Consider donating.

I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!

☕️ Buy me a Coffee ($3)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.