Android로 내보내기

Android로 내보내려면 Godot를 컴파일하는 것보다 요구사항이 적습니다. 다음 단계는 SDK와 엔진을 설정하는데 필요한 것에 대해 설명합니다.

Android SDK 다운로드하기 에서 Android SDK를 다운로드하고 설치하세요.

If you install Android Studio, you need to run it once to complete the SDK setup.

Install OpenJDK 8

Download and install OpenJDK 8, newer versions do not work.

debug.keystore 만들기

Android는 기기에 설치하고 출시하지 않은 APK를 배포하기 위해 디버그 키스토어 파일이 필요합니다. 이전에 SDK를 사용하고 프로젝트를 만든 적이 있다면, ant나 eclipse가 파일이 있을 것입니다 (Linux와 macOS에서, ~/.android 디렉토리에서 찾을 수 있습니다).

If you can't find it or need to generate one, the keytool command from the JDK can be used for this purpose:

keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12

This will create a debug.keystore file in your current directory. You should move it to a memorable location such as %USERPROFILE%\.android\, because you will need its location in a later step. For more information on keytool usage, see this Q&A article.

adb가 있는지 확인하세요

Android Debug Bridge (adb) is the command line tool used to communicate with Android devices. It's installed with the SDK, but you may need to install one (any) of the Android API levels for it to be installed in the SDK directory.

Godot에서 설정하기

Enter the Editor Settings screen. This screen contains the editor settings for the user account in the computer (it's independent of the project).


Android 설정이 있는 섹션까지 내립니다:


이 화면에서 3개의 파일 경로가 설정되어야 합니다:

  • The adb executable (adb.exe on Windows) - It can usually be found at %LOCALAPPDATA%\Android\Sdk\platform-tools\adb.exe.
  • The jarsigner executable (from JDK 6 or 8) - On Windows, OpenJDK installs to a directory like %PROGRAMFILES%\AdoptOpenJDK\jdk-\bin. On Linux, it typically installs to a directory like /usr/bin/jarsigner. The exact path may vary depending on the OpenJDK update you've installed and your machine's operating system.
  • The debug .keystore file - It can be found in the folder where you put the debug.keystore file you created above.

일단 구성되면, Android에 내보낼 준비가 끝납니다!

실행 아이콘 제공

런처 아이콘은 Android 앱에서 사용자에게 애플리케이션을 나타내는 데 사용됩니다. Godot은 고해상도 아이콘 (xxxhdpi) 만 필요하며 저해상도는 자동으로 생성합니다.

There are two types of icons required by Godot:

  • Main Icon: The "classic" icon. This will be used on all Android versions up to Android 8 (Oreo), exclusive. Must be at least 192×192 px.
  • ** Adaptive Icons : ** Android 8 (포함)부터 Adaptive Icons 가 도입되었습니다. 앱은 배경 및 전경 아이콘을 포함해야합니다. 사용자의 런처 응용 프로그램은 아이콘의 애니메이션 및 마스킹을 제어합니다. 432 × 432 픽셀 이상이어야합니다.

더 보기

It's important to adhere to some rules when designing adaptive icons. Google Design has provided a nice article that helps to understand those rules and some of the capabilities of adaptive icons.


The most important adaptive icon design rule is to have your icon critical elements inside the safe zone: a centered circle with a diameter of 66dp (264 pixels on xxxhdpi) to avoid being clipped by the launcher.

If you don't provide some of the requested icons, Godot will replace them using a fallback chain, trying the next in line when the current one fails:

  • Main Icon: Provided main icon -> Project icon -> Default Godot main icon.
  • Adaptive Icon Foreground: Provided foreground icon -> Provided main icon -> Project icon -> Default Godot foreground icon.
  • Adaptive Icon Background: Provided background icon -> Default Godot background icon.

It's highly recommended to provide all requested icons, and at least with the specified resolutions. Only this way your application will look great on all Android devices and versions.

구글 플레이 스토어로 내보내기

APK를 구글 플레이 스토어에 업로드 하려면 비 디버그 키스토어 파일을 서명해야합니다; 그러한 파일은 다음과 같이 생성될 수 있습니다:

keytool -v -genkey -v -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000

이 키스토어와 키는 개발자 ID를 확인하는데 사용됩니다, 암호를 기억하고 안전한 장소에 보관하세요! APK 서명에 대해 더 자세히 배우고 싶다면 구글 Android 개발자 가이드를 사용하세요.

이제 Android 내보내기 프리셋에서 다음 항목을 채우세요:

  • Release: Enter the path to the keystore file you just generated.
  • Release User: Replace with the key alias.
  • Release Password: Key password. Note that the keystore password and the key password currently have to be the same.

Your export_presets.cfg file now contains sensitive information. If you use a version control system, you should remove it from public repositories and add it to your .gitignore file or equivalent.

Don't forget to uncheck the Export With Debug checkbox while choosing the APK's name.


Optimizing the APK size

By default, the APK will contain native libraries for both ARMv7 and ARMv8 architectures. This increases its size significantly. To create a smaller APK, uncheck either Armeabi-v 7a or Arm 64 -v 8a in your project's Android export preset. This will create an APK that only contains a library for a single architecture. Note that applications targeting ARMv7 can also run on ARMv8 devices, but the opposite is not true.

Since August 2019, Google Play requires all applications to be available in 64-bit form. This means you cannot upload an APK that contains just an ARMv7 library. To solve this, you can upload several APKs to Google Play using its Multiple APK support. Each APK should target a single architecture; creating an APK for ARMv7 and ARMv8 is usually sufficient to cover most devices in use today.

You can optimize the size further by compiling an Android export template with only the features you need. See Optimizing a build for size for more information.