How to change application name in NativeScript
Asked Answered
C

3

23

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!

Conveyancer answered 3/10, 2016 at 13:35 Comment(0)
T
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!!!

Taxidermy answered 3/10, 2016 at 16:11 Comment(3)
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 xDConveyancer
I have changed the app name and display name but my changes are not reflectedOccidentalize
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+.Behling
B
21

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>.

Boden answered 14/7, 2018 at 21:29 Comment(5)
Thanks for this. I've submitted PR to update docs github.com/NativeScript/docs/pull/1512 @gonzalo-diaz-ailan can you please mark this as correct? current one is incorrect.Anchovy
@Anchovy 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.Prat
what is title_activity_kimera and how it differs from app_name?Balf
@Prat yea sorry my ans is for Angular only. I don't know how to use the other flavors.Anchovy
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?Lingonberry
S
12

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

Silicosis answered 26/6, 2019 at 12:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.