Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I clean my react-native project to back it up?

I'm developing a mobile app using React-Native, and as I'm the only developer of it, I don't want to use a versioning tool like git, I don't want to host it on the cloud (trust reasons...), and was wondering how can I make backup of my react-native project, in case of an hardware loss.

The obvious way would be to just archive everything, but it weight 2.2GB and about 800mb once compressed. It's ok for one backup, but what if I want to make regular backups?

like image 627
anni Avatar asked Apr 01 '18 23:04

anni


People also ask

What does NPX react native Clean project do?

React Native Clean ProjectCleans your React Native project by purging caches and modules, and reinstalling them again.


1 Answers

To clean

Clean deriveddata with xcode project

cd ios
xcodebuild clean

Clean ios build folder

rm -rf ios/build

Clean ios pods

rm -rf ios/Pods

Clean android studio

cd android
./gradlew clean

Clean android build folders

rm -rf android/build
rm -rf android/app/build

Clean gradle cache

rm -rf android/.gradle

Clean node modules

rm -rf node_modules

Clean watchman cache

watchman watch-del-all

Clean npm cache

npm cache clean

You can now archive everything!

To use a backup

Install back package.json's npm modules

npm install

Install back iOS Pods

cd ios/
pod install
like image 51
anni Avatar answered Oct 10 '22 02:10

anni