[Flutter] 앱 이름 변경하기

2025. 10. 11. 02:15Developers 공간 [Shorts]/Frontend

728x90
반응형
<분류>
A. 수단
- OS/Platform/Tool : Linux, Kubernetes(k8s), Docker, AWS
- Package Manager : node.js, yarn, brew, 
- Compiler/Transpillar : React, Nvcc, gcc/g++, Babel, Flutter

- Module Bundler  : React, Webpack, Parcel

B. 언어
- C/C++, python, Javacsript, Typescript, Go-Lang, CUDA, Dart, HTML/CSS

C. 라이브러리 및 프레임워크 및 SDK
- OpenCV, OpenCL, FastAPI, PyTorch, Tensorflow, Nsight

 


1. What? (현상)

 

이번 글에서는 flutter로 작업시 Android폰과 iOS폰 앱의 이름을 바꾸는 과정을 기록해보려고 합니다.


2. Why? (원인)

  • X

3. How? (해결책)

 

각각 Android 폰과 iOS폰의 이름이 위치한 부분을 살펴보겠습니다. 

 


<Android>

 

1. 앱 이름 (App Name) : 런처(홈 화면)와 최근 앱 목록에 표시되는 이름

  • 위치 : android/app/src/main/AndroidManifest.xml
  • 예시 : <application android:label="" ...>
    ** 아래 <application android:name="">는 io.flutter.app.FlutterApplication과 같은 Manifest Placeholder로, 기본 Android Application 클래스입니다. 주로 앱 시작시 Flutter 엔진 초기 설정 등에 사용됐었습니다.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="android 이름"
        android:name="${applicationName}"
    </application>
</manifest>
더보기

----------------------------------------------------------------

<Display Name>

이외에도 Display Name이라는 것이 있는데, 결국 같은 것입니다.

  • 위치 : android/app/src/main/res/values/strings.xml
  • 예시 : <string name="app_name">앱이름</string>
<string name="app_name">android 이름</string>

 

쉽게 설명하자면 위 설명한 방법과 같이 직접 지정할 수도 있지만 

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="android 이름"
        android:name="${applicationName}"
    </application>
</manifest>


리소스 참조 방식으로 아래와 같이 선언한다면

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="@string/app_name"
        android:name="${applicationName}"
    </application>
</manifest>


res/values/strings.xml 위치에 아래와 같이 정의하는 방법입니다.

<string name="app_name">android 이름</string>


이렇게 하면, 나중에 다국어(예: values-ko, values-en)로 쉽게 확장할 수 있습니다.

----------------------------------------------------------------


2. 앱 ID (Application ID)
 : 실제 패키지 식별자로, (Play Store, 서명, 업데이트) 시 동일해야 합니다.

  • 위치 : android/app/build.gradle
  • 예시 : applicationId "com.example.my_project"
android {
    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "com.example.my_project"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        versionCode = flutter.versionCode
        versionName = flutter.versionName
	}
}

 


<iOS>

 

1. 앱 이름 (Display Name) : 홈 화면에 표시되는 앱 이름

  • 위치 : ios/Runner/Info.plist
  • 예시 : CFBundleDisplayName
<dict>
	<key>CFBundleDisplayName</key>
	<string>ios 이름</string>
</dict>

 

2. 앱 ID (Bundle Identifier) : Apple Developer 계정의 App ID와 동일해야 합니다.

  • 위치 : ios/Runner.xcodeproj/project.pbxproj 또는 Xcode > Runner target > General > Identity
  • 예시 : PRODUCT_BUNDLE_IDENTIFIER = com.example.myProject;
    ** PRODUCT_NAME은 산출물/번들 이름(Runner.app)입니다.
{
    IDEXAMPLEABC /* Profile */ = {
        isa = XCBuildConfiguration;
        baseConfigurationReference = IDEXAMPLEABCDE /* Release.xcconfig */;
        buildSettings = {
            PRODUCT_BUNDLE_IDENTIFIER = com.example.myProject;
            PRODUCT_NAME = "$(TARGET_NAME)";
        };
        name = Profile;
    };
}

 

 

3. Internal Name (bundle name) : 내부 시스템 식별용으로, 일반적으로 위 "1. 앱 이름"과 동일하게 맞춰둡니다.

  • 위치 : ios/Runner/Info.plist
  • 예시 : CFBundleName
    ** iOS에 이와 같은 CFBundleName이 지정되어있지 않으면 위에 나온 PRODUCT_NAME을 자동으로 참조해서 사용하기도 합니다.
<dict>
	<key>CFBundleName</key>
	<string>ios 이름</string>
</dict>

 


어느 위치에서 이름을 바꾸는지 살펴보았으니, 해당 위치의 이름들을 지정해주면됩니다.

 

하지만 번거로운 경우 아래와 같은 패키지를 사용해서 한번에 변경할 수도 있습니다.

** https://pub.dev/packages/rename_app

 

설치와 실행은 아래와 같이 합니다.

flutter pub add rename_app

# Change
dart run rename_app:main all="앱 이름"
dart run rename_app:main ios="iOS 이름" android="Android 이름"
dart run rename_app:main android="Android 이름" ios="ios 이름" others="Others 이름"

 

실제 실행한 경우 아래와 같은 파일들이 수정되는 것을 확인했습니다.

  • iOS
    • ./ios/Runner/Info.plist :  CFBundleDisplayName, CFBundleName
  • Android
    • ./android/app/src/main/AndroidManifest.xml:  <application android:label="나의앱"...>
    • ./web/manifest.json : "name", "short_name"
  • 기타
    • ./linux/runner/my_application.cc :    gtk_header_bar_set_title(header_bar, " 나의앱 ");
    • ./linux/runner/my_application.cc :    gtk_window_set_title(window, " 나의앱 ");
    • ./windows/runner/main.cpp:  if (!window.Create(L" 나의앱 ", origin, size)) {

728x90
반응형