Open react native project in xcode

27,110

Solution 1

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'.

Solution 2

Your'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.

Share:
27,110
smilebomb
Author by

smilebomb

Just a simple web developer :)

Updated on December 17, 2020

Comments

  • smilebomb
    smilebomb over 3 years

    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?

  • smilebomb
    smilebomb over 5 years
    I have followed those instructions, and I am at the point where I want to test on testflight. I have testflight on my ipad, but no "plus" button to add an app. I thought maybe there is some extra step to the build process that expo doesn't handle. In App Store Connect I see my app but nothing is listed under testflight.