我已经使用Flutter create testapp创建了应用程序。 现在,我想将应用程序名称从“testapp”更改为“My Trips Tracker”。我该怎么做呢?
我已经尝试从AndroidManifest.xml进行更改,它已经更改,但是Flutter提供了一种方法来做到这一点吗?
我已经使用Flutter create testapp创建了应用程序。 现在,我想将应用程序名称从“testapp”更改为“My Trips Tracker”。我该怎么做呢?
我已经尝试从AndroidManifest.xml进行更改,它已经更改,但是Flutter提供了一种方法来做到这一点吗?
当前回答
安卓
打开AndroidManifest.xml(位于android/app/src/main)
<application
android:label="App Name" ...> // Your app name here
iOS
开放的信息。plist(位于ios/Runner)
<key>CFBundleDisplayName</key>
<string>App Name</string> // Your app name here
和/或
不要忘记停止并再次运行应用程序。
其他回答
对于Android,从Android文件夹中更改应用程序名称。在AndroidManifest.xml文件中,在android/app/src/main文件夹中,让android标签引用你喜欢的名称,例如:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application
`android:label="myappname"`
// The rest of the code
</application>
</manifest>
你可以通过编辑文件*project/ iOS /Runner/info.plist在iOS中修改它,而不需要打开Xcode。设置<key>CFBundleDisplayName</key>为你想要作为你的名字的字符串。
对于Android,在AndroidManifest.xml文件中的Android文件夹中更改应用程序名称,Android /app/src/main。让android标签引用你喜欢的名称,例如,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application
android:label="test"
// The rest of the code
</application>
</manifest>
查看默认的应用清单文件AndroidManifest.xml,位于<app dir>/android/app/src/main 编辑android:标签为您想要的显示名称
您可以通过更新Android和iOS的名称来更改应用程序名称
为安卓
打开AndroidManifest.xml文件,
进入android>应用程序>src>main>AndroidManifest.xml
像这样:
所以我的应用程序名称是“demo”,所以,我将更新标签值。
与iOS相同 只要打开信息。Plist文件by,
进入ios>Runner>Info.plist
像这样:
改变这个字符串值。
我确实看到了手动解决方案(转向IOS和Android)。但我发现了一个插件,可以从一个单一的位置更改名称:
https://pub.dev/packages/flutter_launcher_name
只需要做以下几点: 添加到pubspec.yaml
dev_dependencies:
flutter_launcher_name: "^0.0.1"
flutter_launcher_name:
name: "yourNewAppLauncherName"
在终端运行:
flutter pub get
flutter pub run flutter_launcher_name:main
完成了。