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?
Thank me with a coffee.

I don\'t do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

BuymeaCoffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Unless noted otherwise, the contents of this post are licensed under the Creative Commons Attribution 4.0 License and code samples are licensed under the MIT License

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.