22

I'm working with NativeScript from Telerik and I made an app with a debug name ("notiApp") but now I can't change the app's name in launcher and action bar.

I already tried configuring my AndroidManifest.xml in /app/App_Resources/Android/ modifying the android:label attribute of my <application> tag.

<?xml version="1.0" encoding="utf-8"?>
<manifest>
    <application
        android:label="DESIRED NAME">
    </application>
</manifest>

Also, I tried changing my project's root directory name for the new app desired name.

There's anything else I can do or any additional information I could provide?

Thanks in advance guys!

Gonzalo Diaz Ailan
  • 583
  • 1
  • 5
  • 23

3 Answers3

36

Go into app >> App_Resources >> Android >> values folder.

There should be a strings.xml file - if not create it.

The content should be

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">DISPLAY APP NAME</string> <string name="title_activity_kimera">APK NAME</string> </resources>

p.s. these stackoverflow content check error messages are annoying!!!

dashman
  • 2,858
  • 3
  • 29
  • 51
  • Thanks a lot! I couldn't find that strings.xml in values folder that is referenced in the documentation. I didn't knew I could just create it! p.s. Yes, they are pretty annoying xD – Gonzalo Diaz Ailan Oct 03 '16 at 17:30
  • I have changed the app name and display name but my changes are not reflected – Alekya Jan 18 '20 at 10:20
  • 1
    Also make sure to update the app name in this file, if needed: `App_Resources/Android/src/main/res/values-v21/strings.xml`. Note that styles applied in the values-v21 folder will be applied only to devices with API 21+. – nicolas.f.g Mar 22 '20 at 18:55
20

For the Angular flavor of NativeScript:

Android app name:

App_Resources/Android/src/main/res/values/strings.xml. Create it if it does not exist. Content is:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="app_name">DISPLAY APP NAME</string>
  <string name="title_activity_kimera">APK NAME</string>
</resources>

iOS App Name

In /Users/ryan/projects/snaptab-mobile-app/App_Resources/iOS/Info.plist replace the <string>${PRODUCT_NAME}</string> value of CFBundleDisplayName with your app name. Ex: <string>My NS APP</string>.

rynop
  • 50,086
  • 26
  • 101
  • 112
Pezhvak
  • 9,633
  • 7
  • 29
  • 39
  • 1
    Thanks for this. I've submitted PR to update docs https://github.com/NativeScript/docs/pull/1512 @gonzalo-diaz-ailan can you please mark this as correct? current one is incorrect. – rynop Jan 22 '19 at 15:37
  • @rynop The selected answer works fine for me. This answer does not as I have no src folder under Android. I am using Nativescript-Vue if that makes any difference. – Jason Jan 28 '19 at 18:39
  • 2
    what is `title_activity_kimera` and how it differs from `app_name`? – Robert Williams Mar 29 '19 at 12:57
  • @Jason yea sorry my ans is for Angular only. I don't know how to use the other flavors. – rynop May 13 '19 at 20:52
  • But would it more accurate to update the `${PRODUCT_NAME}` variable where is that coming from how to update this variable instead of hardcode the name? – Juliano Jul 19 '23 at 13:01
11

this worked for me:

For Android

create App_Resources/Android/src/main/res/values/strings.xml

    <?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">MyAppName</string>
    <string name="title_activity_kimera">MyAppName</string>
</resources>

https://docs.nativescript.org/tooling/publishing/publishing-android-apps#app-name

For IOS

The value is stored in the app/App_Resources/iOS/Info.plist file as the CFBundleDisplayName key. just changed to your custom app name https://docs.nativescript.org/tooling/publishing/publishing-ios-apps#app-name

Reda Daddach
  • 111
  • 1
  • 3