In this article, I will show you how to clear the cache in React Native. (As of November 2023, latest version)
bash
# Delete watchman cache
watchman watch-del-all
# Delete iOS build files
rm -rf ios/build
# Delete Android build files
rm -rf android/app/build
# Delete node_modules
rm -rf node_modules
# Delete Pods
rm -rf ios/Pods
# Delete Podfile.lock
rm ios/Podfile.lock
# Clear Xcode cache
rm -rf ~/Library/Developer/Xcode/DerivedData
# Install yarn
yarn install
# Install pod
cd ios
pod install
# Clear Android build environment
cd ../android
./gradlew clean
# Restart metro bundler
cd ..
yarn start -- --reset-cache
# Once metro bundler has started, press Control + C to stop it
These commands will help you efficiently clear the cache and reset the environment in React Native, ensuring your app’s smooth development and testing process.
LangJournalは、日記を書くことで英語やフランス語などの外国語を学べるアプリです。英語学習に興味がある方や、私が開発したこのアプリに関心を持っている方は、ぜひインストールしてお試しください。
LangJournalのサイトはこちら