How can I regenerate ios folder in React Native project?

后端 未结 13 706
忘掉有多难
忘掉有多难 2020-11-29 20:13

So a while ago I deleted the /ios directory in my react native app (let\'s call it X). I\'ve been developing and testing using the android emulator but now I\'d like to make

13条回答
  •  臣服心动
    2020-11-29 20:44

    The process you need to follow is so similar to renaming a react native app. Basically you just need to run react-native upgrade in your root project directory. For further info you can check another question here. The instructions below explains how to create another react native project based on a copied one with a new name.

    • First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
    • Change the name at index.ios/android.js file which is given as a parameter to AppRegistry.
    • Change the name and version accordingly on package.json
    • Delete /ios and /android folders which are remaining from your older app.
    • Run $react-native upgrade to generate /ios and /android folders again.
    • Run $react-native link for any native dependency.
    • Finally run $react-native run-ios or anything you want.

提交回复
热议问题