How to change display name of an app in react-native

AndroidIosReact Native

Android Problem Overview


Apple have clear instructions on how to change the display name of an IOS app, but they are not useful for a react-native app because the folder structure is different. How do you change the display name if you have a react-native app?

Android Solutions


Solution 1 - Android

iOS

Goto ios/<Appname>/Info.plist and edit the $(PRODUCT_NAME) to change the display name

<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>

Android

Goto android/app/src/main/res/values/strings.xml and edit the APP_NAME to change the name

<string name="app_name">APP_NAME</string>

Solution 2 - Android

for ios just add this to Info.plist

<key>CFBundleDisplayName</key>
<string>APP_NAME</string>

for android edit strings.xml file which located in res/values/

<string name="app_name">APP_NAME</string>

Solution 3 - Android

res -> values -> strings.xml

<string name="app_name">YOUR APP NAME HERE</string>

Change that and you will have changed your display name of the app.

Inside the manifest file, inside the application tag you will find

android:label="@string/app_name"

You can change this too, if you want to change the display name of your app.

Note: It is always recommended to have values stored in the "values" folder instead of hardcoding the values directly.

Solution 4 - Android

There's a file called app.json in the root of your project. Just change the "displayName" then delete ios folder and run "react-native eject".

Solution 5 - Android

file path : /android/app/src/main/res/values/strings.xml

replace My App with your app name.

Solution 6 - Android

Instead of creating an app from a template with a Display Name which needs to be changed later, it would be preferable to create the app with the desired names from the start, as I explain here in my answer. For a new app use:

npx react-native init NewcoFrameDesign --title "Newco Frame Design"

The --title option corresponds to the display name in android/app/src/main/res/values/strings.xml and ios/NewcoFrameDesign/Info.plist as well as in app.json.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionObromiosView Question on Stackoverflow
Solution 1 - AndroidSriramanView Answer on Stackoverflow
Solution 2 - AndroidAli FarisView Answer on Stackoverflow
Solution 3 - AndroidGeet ChoubeyView Answer on Stackoverflow
Solution 4 - AndroidbandojulioView Answer on Stackoverflow
Solution 5 - AndroidArvindView Answer on Stackoverflow
Solution 6 - AndroidChrisWView Answer on Stackoverflow