Unity packaging and switching platforms | Build Settings window introduction

Digression : Meow meow?


1. Menu bar File=>Build Settings...


2. Select the platform you want to switch to on the left, and click Switch Platform

Note : After reading the article, you have successfully switched the current Unity platform.


3. The Switch Platform button will change to Build, and it will be packaged when clicked

Note : Packing will print the installation package of the corresponding platform. For example, if you are currently on Android, then the output will be APK; if you are currently on Windows, the output will be EXE.


4. Excessive pretenses

  • Why did you write this fourth article?
    • Obviously the problem has been solved, CSDN told me that the quality of the article is low and will not be recommended;
    • In order to let more people see it, I didn't write it in vain, so I just said a few words.

5. When the current platform is Android, the meaning of each configuration item

(Thanks to CSDN, I would not write this fifth article without him)

  • Let’s just look at the pictures one by one
    (beginners can pick and choose, but don’t go into the corner, although some things must be learned, but if you learn them at the wrong stage, it may only increase your troubles)
  • Texture Compression : How the textures in the project are compressed.
    • Dont override: It will not override the developer's compression method for certain textures in the project, for example:

Explanation : A certain picture is too big, with a full 10MB. Xiao Ming hopes to perform special processing on the picture on the Android platform to make it smaller. So it changes the resolution, format and quality of that picture. If these settings do not take effect when packing, wouldn’t Xiao Ming’s work be in vain? Therefore, when packaging, select Dont override, then the settings of the picture will be preserved.

  • ETC2 fallback : For Android devices that do not support ETC2 compression, what strategy should Unity use to load them in memory.

    • 32-bit: the highest quality image, which means more memory space is required;
    • 16-bit: low-quality pictures, some color information may be lost, but it means less memory space occupied;
    • 32-bit, half resolution: 32-bit and half resolution, which is a downgrade of 32-bit, saving 75% of memory space and ensuring color information, but it may become blurred~
  • Export Project : If you check it, an Android project will be exported instead of an apk;

    • Why Android project instead of apk?
      • In some cases ( such as Unity's Android development, access to SDK, direct connection to mobile phone debugging, etc. ) what is needed is an Android project instead of an apk. At this point, you only need to use Android Studio to open the Android project exported by Unity, and then you can perform the operations you need~
  • Symlink Sources

    • The Export Project option must be checked before it can be checked by you;
    • A very useful option, you can associate your Unity project with the Java and Kotlin source files of the exported Android project, and modify them synchronously;
    • What does that mean? The previous option taught you how to export an Android project, but if you export an Android project, it has nothing to do with your Unity. If you modify the Android project, the files in Unity will not change .
    • But ! ! As long as you check this option, and then export the Android project, the Java and Kotlin files you modified in the Android project, eh? The files in Unity are also changed synchronously, isn’t it amazing? Is it convenient? Is it easy to use? (❁´◡`❁)
  • Build App Bundle(Google Play) : For domestic developers, don’t look at it. If you check it, the output will be aab instead of apk. To put it bluntly, it is used in the Google App Store, which is not popular in China.

  • Create symbols.zip : Export the symbol table while packaging.

    • Symbol table: The symbol table is a mapping table of memory addresses and function names, file names, and line numbers; it is generally used to translate some memory addresses in app crash logs.
  • Run Device : Determine which device the game runs on;

    • If you only click on Build, then this option will have no effect;
    • If you click Build And Run, Unity will automatically run the game on the device you selected after the packaging is complete;
    • For example : you connect your Xiaomi mobile phone to the computer, then in the list, select Xiaomi, click Build And Run, then Xiaomi will automatically install the game and start running.
  • Development Build : You can think of this option as whether the typed package is for programmers or users; if checked, it means that this package is for programmers to debug games, and some functions will be added. To make it easier for us to debug the game.

Explanation : Several options in the red box can be regarded as one. Only when Development Build is checked, the following ones can be checked~

  • Autoconnect Profiler : After checking, when the mobile phone is connected to the computer and your game is installed on the mobile phone, you can use Unity's performance analysis tool to debug your game more elegantly, um, very elegant~

  • Deep Profiling : Similar to the previous one, but! ! It will return more detailed data to the analysis panel, allowing you to refine the performance consumed by each function call, which may cause your game to slow down~

  • Script Debugging : Whether to allow the app to debug your code. In the vernacular, you are allowed to reproduce the bug on the mobile phone by interrupting the point, and check where there is a problem. After all, there are many disgusting bugs that only appear on mobile phones, but not on Unity.

Interested children's shoes: https://docs.unity.cn/cn/current/Manual/android-debugging-on-an-android-device.html

  • Scripts Only Build : Whether to recompile and build only scripts. Meaning, only script-level changes are processed, but no other resources in the project are processed. (never used, doubtful)

  • Compression Method : Which method Unity uses to compress your assets when packaging. There are three options:

    • Default: The Zip compression method is used by default. Although the size is small, the decompression is relatively slow, which will affect the game performance~
    • LZ4: Compared with Zip, the compression rate of LZ4 is lower, but the decompression efficiency is very high, which will obviously improve the game performance~
    • LZ4HC: It is a high-compression version of LZ4, which will lengthen the packaging time, but can reduce the package size + improve game performance~

Digression : I knocked, so tired. . . For the next article, let’s just procrastinate. . .

Guess you like

Origin blog.csdn.net/Liyager/article/details/124491596
Recommended