Change the name of your project in your package.json under the "name" field. Then run:
Make sure you change the references in your
AppRegistry.registerComponent('NewProjectName', () => NewProjectName);
Remove Old Project Files, Folders, & References
You may find that after the step above the
react-native command fails with PCH issues
Error PCH was compiled with module cache path
This is because you have references, folders, and files hanging around from the old project namespace.
Delete the old project folders
rm -rf ios/build rm -rf ios/OldProjectName rm -rf ios/OldProjectNameTests rm -rf ios/OldProjectName.xcodeproj
Delete the old project folder
rm -rf android/app/src/main/java/com/OldProjectName
Change references in these 4 files
You will find references to your old project name in these files. You can do a global search and replace in the
./android folder to make life easier. There aren't that many references though and doing it by hand isn't hard.
android/settings.gradle android/app/build.gradle android/app/src/main/AndroidManifest.xml android/app/src/main/res/values/strings.xml
Clear cached references
You may have some cached references hanging around in Xcode. To resolve this simply open Xcode hold down the Option key and from the system toolbar choose
Product > Clean Build Folder
Everything should be working now. Run your app and try it out.
react-native run-ios # OR react-native run-android