smilebomb
smilebomb

Reputation: 5493

Open react native project in xcode

I'm sure I'm missing something simple. I have a React Native project working and I'm attempting to get it on the app stores. Following those instructions, after I have created my provisioning profile in the Apple Developer Dashboard, it says to double click the developer provisioning profile to launch xcode. It's these instructions exactly:

Now find the files you just downloaded on your computer, and double-click each of them in turn, causing Xcode to launch. Verify the profiles are there by opening a project or starting a new one for this test.

So I double-click my file, and xcode does launch but no windows open up. I do not have an xcode project for my react native app so I have nothing to open. There is no menus for 'build settings' or 'general' so I'm not sure how to proceed.

For reference, here is my react native directory structure:

my_project/
    .expo/
    assets/
    node_modules/
    src/
    .bablerc
    .gitignore
    App.js
    app.json
    package-lock.json
    package.json
    README.md

Did I miss a step somewhere? How do I get an xcode project from this?

Upvotes: 22

Views: 55616

Answers (3)

sanjar
sanjar

Reputation: 1101

You're using Expo's ecosystem to build the app, you'll have to use Expo to build/publish it. You should check the expo's documentation.

If you really want to build it from xcode you could run react-native eject to quit this ecosystem. It'll create android and ios folders and you'll be able to build/publish your app manually.

Upvotes: 5

Ben Butterworth
Ben Butterworth

Reputation: 28988

For normal (not expo) react-native cli projects:

Run xed ios when inside your react-native project root directory. It opens Xcode at the ios directory. Or open ios/PROJECT_NAME.xcworkspace. xed is the Xcode text editor invocation tool.

I added this because even though the author uses expo, this question was first on my non-expo search results. You might find using Xcode more convenient than editing PLIST, XML or other configuration files directly, as well as 'archiving' your application to then upload onto the App Store. I remember when I first learning React Native, and thought I wouldn't need to use XCode. I was very wrong.


For "fully managed" expo projects, you don't actually have access to the native code (ios or android files). To have access to/ modify the native code, you need to go into the 'bare workflow'.

Upvotes: 59

He please, to open the project in XCode, first you need generate the ios folder, for that use the cmd: react-native eject

Rgds

Upvotes: 0

Related Questions