How can I change the app display name build with Flutter?
Asked Answered
F

20

419

I have created the app using Flutter create testapp. Now, I want to change the app name from "testapp" to "My Trips Tracker". How can I do that?

I have tried changing from the AndroidManifest.xml, and it got changed, but is there a way that Flutter provides to do that?

Forefend answered 18/3, 2018 at 21:53 Comment(3)
The manifest is the only way to change the name that is shown in the Settings app and the name shown on your launcher icon.Metchnikoff
For visual people this video will show you the whole process youtube.com/watch?v=05twEATiS44Porett
Use a plugin,it's easy, fast, secure,and already tested by the comunity, the flutter_app_name package it's a great option, and have support for null-safety. The other recommended package is flutter_launcher_name, but basically flutter_launcher_name don't support null safety, check the Null safety support.Grose
P
286

UPDATE: From the comments this answer seems to be out of date

The Flutter documentation points out where you can change the display name of your application for both Android and iOS. This may be what you are looking for:

For Android

It seems you have already found this in the AndroidManifest.xml as the application entry.

Review the default App Manifest file AndroidManifest.xml located in /android/app/src/main/ and verify the values are correct, especially:

application: Edit the android:label in the application tag to reflect the final name of the app.

For iOS

See the Review Xcode project settings section:

Navigate to your target’s settings in Xcode:

In Xcode, open Runner.xcworkspace in your app’s ios folder.

To view your app’s settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target.

Select the General tab. Next, you’ll verify the most important settings:

Display Name: the name of the app to be displayed on the home screen and elsewhere.

For Windows

goto the windows/runner/main.cpp file and check the name in line 30:

if (!window.Create(L"YourAPPName", origin, size)) {
    return EXIT_FAILURE;
}

For Linux

goto linux/my_application.cc edit these two lines (I never tested it)

gtk_header_bar_set_title(header_bar, "AppName");
gtk_window_set_title(window, "AppName");
Presently answered 19/3, 2018 at 0:49 Comment(8)
Yeah, thanks for the answer. I knew the native methods to do that. I was just curious to know if flutter handles it from a single point.Forefend
These are native methods to do that. I want to know flutter handles it from a single point or not?Acromegaly
@AshtonThomas I can change this but after cleaning rebuilding etc, runner app resets its value, how can I keep this?(As I understand Runner project is recreated after clean build or so)Jimerson
If you change Display Name in the runner project it will stop working. It has to be ´Runner' Apparently, it is necessary to change the name and version data on the pubspeck.yaml file only, which is quite incovenient if android and ios apps have different versions or name localizationTomkins
@Jimerson Were you able to figure out? Am also having the same issueEntreat
For iOS this is incorrect. One should change the CFBundleName in Info.plist. Flutter will not find the app, as it will look for the Runner.app, and if you change it in Xcode that is no longer the case.Baffle
This answer is just wrong, at least for iOS. To change the name that is displayed under the Apps icon in iOS, I had to go to App Directory > ios > Runner, open info.plist and change the 'bundle name' from 'app' to whatever I would like to call it. That is the only thing which actually worked. Changing Runner in Runner.xcworkspace will not allow you to run the app after the next build.Overstrain
I found a plugin to change display name of both at one location: pub.dev/packages/flutter_launcher_nameYu
G
671

Android

Open AndroidManifest.xml (located at android/app/src/main)

<application
    android:label="App Name" ...> // Your app name here

iOS

Open info.plist (located at ios/Runner)

<key>CFBundleDisplayName</key>
<string>App Name</string> // Your app name here

and/or

enter image description here


Don't forget to stop and run the app again.

Gratt answered 8/5, 2019 at 11:0 Comment(8)
For Android, this does not work. Trying to change from <OldName> to <NewName>, the error message sais: Manifest merger failed : Attribute application@label value=(OldName) from AndroidManifest.xml:21:9-32 is also present at AndroidManifest.xml:21:9-32 value=(NewName).. What do you suggest ??Anastasius
You may have more than one AndroidManifest.xml file in your project, you will have to open the one located at android/app/src/main.Gratt
This appears to be all sorts of broken with the latest IOS updates and/or Catalina updates and/or Flutter updates. I have no idea. Changing this now breaks the deployment as it renames the <appname>.app folder from a consistent Runner.app to whatever you put in display name, and then "flutter run" breaks. Now, if you want to change it, you name the name:<value> key in the YAML file, then do global search/replace on the package name. (sigh)Harve
what about name in pubspec.yamlChiarra
@Chiarra That's just the name of your project. For names, you'll have to edit the AndroidManifest.xml file (in Android) and info.plist (in iOS). Flutter docs mention it too.Gratt
how to add space between the app name, ios info.plist doesnt support space.Draughtsman
@Gratt is it a better practice to define the android app name inside strings.xml instead of hardcoding it?Diaphaneity
@HaidarMehsen Yes, you should if you're targeting different locales.Gratt
P
286

UPDATE: From the comments this answer seems to be out of date

The Flutter documentation points out where you can change the display name of your application for both Android and iOS. This may be what you are looking for:

For Android

It seems you have already found this in the AndroidManifest.xml as the application entry.

Review the default App Manifest file AndroidManifest.xml located in /android/app/src/main/ and verify the values are correct, especially:

application: Edit the android:label in the application tag to reflect the final name of the app.

For iOS

See the Review Xcode project settings section:

Navigate to your target’s settings in Xcode:

In Xcode, open Runner.xcworkspace in your app’s ios folder.

To view your app’s settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target.

Select the General tab. Next, you’ll verify the most important settings:

Display Name: the name of the app to be displayed on the home screen and elsewhere.

For Windows

goto the windows/runner/main.cpp file and check the name in line 30:

if (!window.Create(L"YourAPPName", origin, size)) {
    return EXIT_FAILURE;
}

For Linux

goto linux/my_application.cc edit these two lines (I never tested it)

gtk_header_bar_set_title(header_bar, "AppName");
gtk_window_set_title(window, "AppName");
Presently answered 19/3, 2018 at 0:49 Comment(8)
Yeah, thanks for the answer. I knew the native methods to do that. I was just curious to know if flutter handles it from a single point.Forefend
These are native methods to do that. I want to know flutter handles it from a single point or not?Acromegaly
@AshtonThomas I can change this but after cleaning rebuilding etc, runner app resets its value, how can I keep this?(As I understand Runner project is recreated after clean build or so)Jimerson
If you change Display Name in the runner project it will stop working. It has to be ´Runner' Apparently, it is necessary to change the name and version data on the pubspeck.yaml file only, which is quite incovenient if android and ios apps have different versions or name localizationTomkins
@Jimerson Were you able to figure out? Am also having the same issueEntreat
For iOS this is incorrect. One should change the CFBundleName in Info.plist. Flutter will not find the app, as it will look for the Runner.app, and if you change it in Xcode that is no longer the case.Baffle
This answer is just wrong, at least for iOS. To change the name that is displayed under the Apps icon in iOS, I had to go to App Directory > ios > Runner, open info.plist and change the 'bundle name' from 'app' to whatever I would like to call it. That is the only thing which actually worked. Changing Runner in Runner.xcworkspace will not allow you to run the app after the next build.Overstrain
I found a plugin to change display name of both at one location: pub.dev/packages/flutter_launcher_nameYu
B
57

There is a plugin called flutter_launcher_name.

Write file pubspec.yaml:

dev_dependencies:
  flutter_launcher_name: "^0.0.1"

flutter_launcher_name:
  name: "yourNewAppLauncherName"

And run:

flutter pub get
flutter pub run flutter_launcher_name:main

You can get the same result as editing AndroidManifest.xml and Info.plist.

Bridgman answered 11/12, 2019 at 5:11 Comment(8)
Nice! I'll test the plugin. But as far as I know, if you change the Display Name on the info.plist file from 'Runner', the app stops compiling. It has to be 'Runner'.Tomkins
Sorry it is not working. Like Dpedrinha said, it has to be 'Runner'.Bowing
it's working for me. But i need to delete the app and reinstall it after run: flutter pub run flutter_launcher_name:mainPeninsula
There is also a plugin to replace the icon pub.dev/packages/flutter_launcher_iconsUtile
The plugin was not updated for flutter 2.0 and has dependency issuesDysprosium
I had the followin error that went away when I removed the flutter_launcher_name dependency: Flutter – Error: ADB exited with exit code 1Wintery
There is a paliative solution for the problem with the plugin according to this commentDeth
This plugin is no longer valid as it has not been upgraded to Flutter 2, so you will run into dependency issues. flutter_app_name (pub.dev/packages/flutter_app_name) is a nearly identical plugin but works with Flutter 2.0.Svetlanasvoboda
T
38

You can change it in iOS without opening Xcode by editing the project/ios/Runner/info.plist <key>CFBundleDisplayName</key> to the String that you want as your name.

FWIW - I was getting frustrated with making changes in Xcode and Flutter, so I started committing all changes before opening Xcode, so I could see where the changes show up in the Flutter project.

Tonsure answered 21/9, 2018 at 18:27 Comment(0)
A
19

You can easily do this with rename package, It helps you to change your Flutter project's AppName and BundleId for any platform you want and it is currently supporting all the 6 platforms (Android, IOS, Linux, macOS, Windows, and Web).

  • To install the package run the following command:
flutter pub global activate rename
  • To rename the App, use the following command:
flutter pub global run rename setAppName --targets ios,android,macos,windows,linux,web --value "Your App Name"

That's It!


You can check the documentation of the package for full details because it has some nice features to choose the target platform and more.

Alunite answered 11/6, 2022 at 8:4 Comment(2)
Great solution. I use this package for renaming projects too. You may need to add flutter before pubMoan
Not working. I dont knwo why. It was working earlier.Analog
H
19

Android

android/app/src/main/AndroidManifest.xml

<application
    android:label="Display Name" // <---- HERE

iOS and macOS

ios/runner/Info.plist

<key>CFBundleDisplayName</key>
<string>Display Name</string> // <---- HERE

Windows

windows/runner/Runner.rc

BEGIN
    VALUE "CompanyName", "com.company" "\0"
    VALUE "FileDescription", "Display Name" "\0" // <---- HERE
    VALUE "FileVersion", VERSION_AS_STRING "\0"
    VALUE "InternalName", "Display Name" "\0" // <---- HERE
    VALUE "LegalCopyright", "Copyright (C) 2023 com.company. All rights reserved." "\0"
    VALUE "OriginalFilename", "appname.exe" "\0"
    VALUE "ProductName", "Display Name" "\0" // <---- HERE
    VALUE "ProductVersion", VERSION_AS_STRING "\0"
END

windows/CMakeLists.txt (and not windows/runner/CMakeLists.txt)

set(BINARY_NAME "appname") // <---- HERE TO CHANGE OUTPUT FILE appname.exe

windows/runner/main.cpp

if (!window.Create(L"Display Name", origin, size)) {
    return EXIT_FAILURE;
}
Helladic answered 28/4, 2023 at 15:35 Comment(0)
I
18

There are several possibilities:

1- The use of a package:

I suggest you to use flutter_launcher_name because of the command-line tool which simplifies the task of updating your Flutter app's launcher name.

Usage:

Add your Flutter Launcher name configuration to your pubspec.yaml file:

dev_dependencies:
  flutter_launcher_name: "^0.0.1"

flutter_launcher_name:
  name: "yourNewAppLauncherName"

After setting up the configuration, all that is left to do is run the package.

flutter pub get
flutter pub run flutter_launcher_name:main

If you use this package, you don't need modify file AndroidManifest.xml or Info.plist.

2- Edit AndroidManifest.xml for Android and info.plist for iOS

For Android, edit only android:label value in the application tag in file AndroidManifest.xml located in the folder: android/app/src/main

Code:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="Your Application Name"  //here
        android:icon="@mipmap/ic_launcher">
        <activity>
        <!--  -->
        </activity>
    </application>
</manifest>

Screenshot:

Enter image description here

For iOS, edit only the value inside the String tag in file Info.plist located in the folder ios/Runner .

Code:

<plist version="1.0">
<dict>
    <key>CFBundleName</key>
    <string>Your Application Name </string>  //here
</dict>
</plist>

Screenshot:

Enter image description here

Do a flutter clean and restart your application if you have a problem.

Isfahan answered 25/12, 2020 at 13:21 Comment(0)
M
16
  • Review the default app manifest file, AndroidManifest.xml, located in <app dir>/android/app/src/main

  • Edit the android:label to your desired display name

Mezcaline answered 14/3, 2019 at 11:2 Comment(0)
S
11

A few of the answers here suggest using the package flutter_launcher_name, but this package is no longer being maintained and will result in dependency issues within new Flutter 2.0 projects.

The plugin flutter_app_name (https://pub.dev/packages/flutter_app_name) is a nearly identical package that has sound null safety and will work with Flutter 2.0.

  1. Set your dev dependencies and your app's name
dev_dependencies:
  flutter_app_name: ^0.1.1

flutter_app_name:
  name: "My Cool App"
  1. Run flutter_app_name in your project's directory
flutter pub get
flutter pub run flutter_app_name

Your launcher will now have the name of "My Cool App".

Svetlanasvoboda answered 30/6, 2021 at 0:29 Comment(0)
P
8

You can change it in iOS without opening Xcode by editing file *project/ios/Runner/info.plist. Set <key>CFBundleDisplayName</key> to the string that you want as your name.

For Android, change the app name from the Android folder, in the AndroidManifest.xml file, android/app/src/main. Let the android label refer to the name you prefer, for example,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <application
        android:label="test"
        // The rest of the code
    </application>
</manifest>
Percept answered 5/8, 2020 at 11:56 Comment(3)
Shouldn't the tag application be closed after android:label="test"? Or is all of "The rest of the code" (XML) attributes?Allurement
yes it should be closed last after all the tags cuz it's the parent of all tagsPercept
this answer worked for me, setting <key>CFBundleDisplayName</key> to the new app name. other answers said set <key>CFBundleName</key> to the app name, but that did not work for me.Vignola
A
7

You can change the Application name, by updating the name for both Android and iOS

for Android

just open AndroidManifest.xml file by,

go to inside android>app>src>main>AndroidManifest.xml

like this:- enter image description here

so my application name is a "demo" so, I will update the label value.

same as for iOS just open Info.plist file by,

go to inside ios>Runner>Info.plist

like this:- enter image description here

And change this string value.

Athletics answered 18/2, 2022 at 12:19 Comment(0)
H
6

One problem is that in iOS Settings (iOS 12.x) if you change the Display Name, it leaves the app name and icon in iOS Settings as the old version.

Havoc answered 18/1, 2019 at 4:40 Comment(1)
what helped me: go to "Info" Tab and change "Bundle name".Bowing
P
5

For Android, change the app name from the Android folder. In the AndroidManifest.xml file, in folder android/app/src/main, let the android label refer to the name you prefer, for example,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <application
        `android:label="myappname"`
        // The rest of the code
    </application>
</manifest>
Phrenic answered 18/9, 2019 at 21:5 Comment(1)
Should the backticks literally be there?Allurement
Y
3

I saw indeed the manual solution (to go to IOS and Android). But I found out a plugin which enables changing name from one single location:

https://pub.dev/packages/flutter_launcher_name

Just do the following: Add to pubspec.yaml

dev_dependencies: 
  flutter_launcher_name: "^0.0.1"
  
flutter_launcher_name:
  name: "yourNewAppLauncherName"

Run in Terminal:

flutter pub get
flutter pub run flutter_launcher_name:main

Done.

Yu answered 23/3, 2022 at 9:3 Comment(2)
A more recent version of this module, compatible with Flutter 2 and with null safety, is pub.dev/packages/flutter_app_nameTomtit
Even newer than the published package is the repo itself: github.com/f-prime/flutter_app_name which includes changes to support setting the bundleId (iOS) / applicationId (android) thanks to PR1Supersaturate
N
2

As of 2019-12-21, you need to change the name [NameOfYourApp] in file pubspec.yaml. Then go to menu EditFindReplace in Path, and replace all occurrences of your previous name.

Also, just for good measure, change the folder names in your android directory, e.g. android/app/src/main/java/com/example/yourappname.

Then in the console, in your app's root directory, run

flutter clean
Norland answered 21/12, 2019 at 8:58 Comment(1)
I wonder how you put display name in pubspec with all spaces, cyrillic letters, etc.Leucine
S
2

in case you are releasing for multi-localizations (languages).

for Android:

in your app folder at [appname]\android\app\src\main\res add locale folders for example:

values-ar

valuse-en

then inside each folder add a new strings.xml that contains the app name in that language.

for ar

<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <string name="app_name">ادارة الديون</string>
</resources>

for en

<?xml version="1.0" encoding="UTF-8"?>
    <resources>
        <string name="app_name">debt management</string>
    </resources>

The last thing you can do is go to your AndroidManifest.xml file and set the android:label to the new files you have created.

android:label="@string/app_name"
Somatotype answered 26/7, 2022 at 8:52 Comment(0)
J
1

First Rename your AndroidManifest.xml file

android:label="Your App Name"

Second Rename Your Application Name in Pubspec.yaml file name: Your Application Name

Third Change Your Application logo

flutter_icons:
   android: "launcher_icon"
   ios: true
   image_path: "assets/path/your Application logo.formate"

Fourth Run

flutter pub pub run flutter_launcher_icons:main
Jacksmelt answered 14/2, 2021 at 13:55 Comment(0)
G
0

If you like to automate stuff from command line like me, you can use this

appName="TestApp"
declare -a androidAppTypes=(
    "main"
    "debug"
    "profile"
)

# Change app name for Android
for appType in ${androidAppTypes[@]}
do
    xmlstarlet ed -L -u '/manifest/application/@android:label' -v "$appName" android/app/src/$appType/AndroidManifest.xml
done

# Change app name for Android
plutil -replace CFBundleDisplayName -string "$appName" ios/Runner/Info.plist
Goodhen answered 22/10, 2022 at 3:33 Comment(0)
L
0

Run this command in the terminal:

flutter pub add rename_app

Provide your app name in the following way:

flutter pub add rename_app:main android="Android Name" ios="IOS Name" web="Web Name" mac="Mac Name" windows="Windows Name" 
Liesa answered 22/9, 2023 at 21:45 Comment(0)
T
-1

The way of changing the name for iOS and Android is clearly mentioned in the documentation as follows:

But, the case of iOS after you change the Display Name from Xcode, you are not able to run the application in the Flutter way, like flutter run.

Because the Flutter run expects the app name as Runner. Even if you change the name in Xcode, it doesn't work.

So, I fixed this as follows:

Move to the location on your Flutter project, ios/Runner.xcodeproj/project.pbxproj, and find and replace all instances of your new name with Runner.

Then everything should work in the flutter run way.

But don't forget to change the name display name on your next release time. Otherwise, the App Store rejects your name.

Tetrabranchiate answered 6/3, 2020 at 5:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.