React Native: Rename my app

You started building your app before you knew what it was, didn’t you? Well, that is certainly what I did.

My app started as “SlackBird”, then I realized that i may be violating some trademark there ( hint: probably not “bird” ), so I went and changed the name to “TLDR“. But after that I realized my addiction to Party Parrot so “TeamParrot” it is!

So what files should I actually change?

IOS

  • When you go to project details in Xcode, you can edit name. When you edit it, Xcode “Rename files” tool opens.Screen Shot 2016-10-19 at 22.37.32 PM.png
  • In ios/PROJECT/info.plist change CFBundleURLName
  • In ios/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcschemechangeBuildableName`
  • Rename file ios/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme itself to NEWPROJECT.xcsccheme

Android

I just grepped for files containing my old name “TLDR” in this instance. These variables needed to be changed:

  • package in android/app/BUCK
  • applicationId in android/app/build.gradle
  • package in android/app/src/main/AndroidManifest.xml
  • return value of getMainComponentName in android/app/src/main/java/com/slackbird/MainActivity.java . That is the name of your main component in JavaScript portion.
  • package in android/app/src/main/java/com/PROJECT/MainApplication.java
  • Application name in android/app/src/main/res/values/strings.xml

React part

Now you renamed your min entry point to your application. So don’t forget to rename your main component name:

AppRegistry.registerComponent( 'TeamParrot', () => Login );

If you renamed everything, some directories will still have old name of your app. I decided I’m fine with that.

React Native Isomorphic app over the weekend

This article is part of my “React Native Isomorphic app over the weekend” series. It shares the problems I encountered during development of TeamParrot and Headstart Journal.

[display-posts tag=”React-Native-Weekend” wrapper=”ul”]

1 Comment

Leave a Reply