简体   繁体   中英

How to Reset IOS folder in react-native

I'm working on a react-native application, I made some mistakes on the iOS project side. Android goes well and no problems. I would like to know if there is any solution to completely reset the iOS project without losing the Android project.

When running the react-native run-ios command, the iOS simulator starts and remains locked in info IDEDerivedDataPathOverride

What I tried to do:

cd ios
pod deintegrate
pod install

-------- the same problem, did not work

I check on npm and I found a package react-native-clean-project and i ran: ./node_modules/.bin/react-native-clean-project --remove-iOS-build

-------- the same problem

rm -rf ios/build 

-------- the same problem

and in last thing i remove the node_modules folder, install it again, clean the cache, but is the same problem...

I want to make a fresh ios folder, like when create a fresh project, but just for iOS.

Delete /ios folders

Run $react-native upgrade to generate /ios folder again.

Run $react-native link

Run $react-native run-ios .

This is my solutuion... (partially)

Downgrade the version of my repo, i pulled 2 commits behind

The after i tried to do:

watchman watch-del-all && 
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* && 
rm -rf node_modules/ 
&& npm cache clean --force &&
npm install
npm start -- --reset-cache

(but i have some errs on watchman, is something like “watch-dell-all” si not a common command)

Then after a tried this:

sudo npm cache clean —force

npm install —save

react-native run-ios

No result here, so i decided to remove node_modules and after that to install via yarn (i don't know why) but after this i finally open my project in Xcode when i'we made a build from Xcode.. I've linked again with react-native link after that now, i can run react-native run-ios but i have some errors on FBSDKShareKit, i'm working now to solve that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM