How can I regenerate ios folder in React Native project?

后端 未结 13 718
忘掉有多难
忘掉有多难 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:51

    It seems like react-native eject is no more available. The only way I could find for recreating the ios folder was to generate it from scratch.

    Take a backup of your ios folder

    mv /path_to_your_old_project/ios /path_to_your_backup_dir/ios_backup
    

    Navigate to a temporary directory and create a new project with the same name as your current project

    react-native init project_name
    mv project_name/ios /path_to_your_old_project/ios
    
    

    Install the pod dependencies inside the ios folder within your project

    cd /path_to_your_old_project/ios
    pod install
    

提交回复
热议问题