unity 安卓 支付宝打包

啊叻?视频不见了?程序写累了,就来玩玩酷跑小游戏吧,嘿嘿。
雨松MOMO送你一首歌曲,嘿嘿。
Unity3D研究院之Android使用ANT自动打包(七十九)
Unity3D研究院之Android使用ANT自动打包(七十九)
围观29732次
编辑日期: 字体:
好久没有写博客了,并不是我不想写,而真是没有时间写。感谢这段时间大家的留言,如果我没有回复的请见谅。最近做了一段时间Android渠道包的接入也算积累了点经验,希望可以帮助以后的朋友们,嘿嘿。
Unity打Android渠道包的传统步骤是,先把SDK放在plugins目录下,设置好证书后最后用unity直接生成.apk。 这是的确是正确的打包方式,但是这样做非常容易出错,SDK不能直接放在plugins目录下,必须要先编译。有些渠道的SDK TMD不是编译好的.jar 而是一个android工程,你必须要让你的unity工程去依赖它。。。所以这样做一不小心就会出错。。
为了彻底解决容易出错的问题,那么我们一定要使用Android的Ant来打包。结合到Unity的工作原理就是,先把unity工程导出成一个android工程,然后在把渠道的 assets lib 依赖 以及icon 拷贝进去,最后通过ant直接生成apk来。
1.先将unity导出成android工程,大家可以看我以前的文章。
2.拷贝assets lib 依赖 以及icon
其实无非也就是shell脚本的 cp命令,多余的我也就不说了。这里我需要说一下splash启动图,unity不允许在android工程里面设置启动图,必须要在unity里设置。可以提前把一张启动图放在unity里面,然后在ProjectSetting里面关联上启动图,自动打包的时候根据不同的渠道将splash图片覆盖一下unity工程里面的图片,然后导出即可。
3.Android 与 ant 环境搭建
建议你直接下载ADT ,这里不仅包含SDK也包含开发编辑器。如下图所示eclipse就是ADT开发编辑器,sdk就是android的sdk
如下图所示,记得要SDK都更新到最新,不然ant打包会报错。
打开ADT(Eclipse)在导航菜单栏中选择Help -& Install New Software
Work with中输入
如下图所示,在下拉列表中选择General Purpose Tools 找到Eclipse Plug-in Development Environment (因为我已经装过了,所以这里不显示) 安装即可。
安装完毕后,打开终端直接输入 open -e .bash_profile
如下图所示,将ANT 和Android的环境变量都配置完毕。记得要关闭一下本文以及终端,方可生效。
到这一步ant的环境已经配置完毕。如下图所示,在ANT打包前我们要先把android工程生成出来。
AndroidManifest.xml 游戏名 包名 activity service都在这里,这里不做过多的解释了。。
assets:unity的.so放在这里。如果渠道包assets下面有文件也一并放在这里。
bin:就不用管了,他是android编译生成出来的。
build.xml:ant打包必备的资源文件,之前我们配置的环境变量就是为了它。下面我在贴出来内容。
gen:生成出来的,不用管了。
keystore.properties:证书的描述文件,证书的路径、密码啊啥的都在这里。
libs:将渠道libs文件夹下的拷贝机进来。
project.properties:如果渠道包是一个工程,那么就必须在这里进行依赖。这里写的就是依赖工程的路径。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
&?xml version="1.0" encoding="UTF-8"?&&project name="Game" default="help"&&&&&&&!-- The local.properties file is created and updated by the 'android' tool.&&&&&&&& It contains the path to the SDK. It should *NOT* be checked into&&&&&&&& Version Control Systems. --&&&&&&!--&property file="local.properties" /&--&&&&&&!--&condition property="sdk.dir" value="D:\\android\\android-sdk"&
&os family="windows"/&&&&&&/condition& &condition property="sdk.dir" value="/Users/dev/android-sdk"&
&os family="mac"/&&&&&&/condition&--&&&&&&&!-- The ant.properties file can be created by you. It is only edited by the&&&&&&&& 'android' tool to add properties to it.&&&&&&&& This is the place to change some Ant specific build properties.&&&&&&&& Here are some properties you may want to change/update:&&&&&&&&& source.dir&&&&&&&&&&&& The name of the source directory. Default is 'src'.&&&&&&&& out.dir&&&&&&&&&&&& The name of the output directory. Default is 'bin'.&&&&&&&&& For other overridable properties, look at the beginning of the rules&&&&&&&& files in the SDK, at tools/ant/build.xml&&&&&&&&& Properties related to the SDK location or the project target should&&&&&&&& be updated using the 'android' tool with the 'update' action.&&&&&&&&& This file is an integral part of the build system for your&&&&&&&& application and should be checked into Version Control Systems.&&&&&&&&& --&&&&&&property file="keystore.properties" /&&&&&&&!-- if sdk.dir was not set from one of the property file, then&&&&&&&& get it from the ANDROID_HOME env var.&&&&&&&& This must be done before we load project.properties since&&&&&&&& the proguard config can use sdk.dir --&&&&&&property environment="env" /&&&&&&condition property="sdk.dir" value="${env.ANDROID_SDK}"&&&&&&&&&&isset property="env.ANDROID_SDK" /&&&&&&/condition&&&&&&&!-- The project.properties file is created and updated by the 'android'&&&&&&&& tool, as well as ADT.&&&&&&&&& This contains project specific properties such as project target, and library&&&&&&&& dependencies. Lower level build properties are stored in ant.properties&&&&&&&& (or in .classpath for Eclipse projects).&&&&&&&&& This file is an integral part of the build system for your&&&&&&&& application and should be checked into Version Control Systems. --&&&&&&loadproperties srcFile="project.properties" /&&&&&&&!-- quick check on sdk.dir --&&&&&&fail&&&&&&&&&&&&message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."&&&&&&&&&&&&unless="sdk.dir"&&&&/&&&&&&&!-- Import the actual build file.&&&&&&&&& To customize existing targets, there are two options:&&&&&&&& - Customize only one target:&&&&&&&&&&&& - copy/paste the target into this file, *before* the&&&&&&&&&&&&&& &import& task.&&&&&&&&&&&& - customize it to your needs.&&&&&&&& - Customize the whole content of build.xml&&&&&&&&&&&& - copy/paste the content of the rules files (minus the top node)&&&&&&&&&&&&&& into this file, replacing the &import& task.&&&&&&&&&&&& - customize to your needs.&&&&&&&&& ***********************&&&&&&&& ****** IMPORTANT ******&&&&&&&& ***********************&&&&&&&& In all cases you must update the value of version-tag below to read 'custom' instead of an integer,&&&&&&&& in order to avoid having your file be overridden by tools such as "android update project"&&&&--&&&&&&!-- version-tag: 1 --&&&&&&import file="${sdk.dir}/tools/ant/build.xml"/&&&/project&
最后就是ant打包的指令了。
tempEclipsePath:是android 工程路径,先clean在release。
ant -buildfile ${tempEclipsePath}/build.xml clean
ant -buildfile ${tempEclipsePath}/build.xml release
这样包就打在了bin目录下面,可以mv把apk拷贝到你需要的目录下面就好了。
mv -f ${tempEclipsePath}/bin/Game-release.apk ${out}
本文固定链接:
转载请注明:
雨松MOMO提醒您:亲,如果您觉得本文不错,快快将这篇文章分享出去吧 。另外请点击网站顶部彩色广告或者捐赠支持本站发展,谢谢!
作者:雨松MOMO
专注移动互联网,Unity3D游戏开发
如果您愿意花10块钱请我喝一杯咖啡的话,请用手机扫描二维码即可通过支付宝直接向我捐款哦。
您可能还会对这些文章感兴趣!Unity安卓打包,安卓发布的流程
[问题点数:40分]
Unity安卓打包,安卓发布的流程
[问题点数:40分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2015年7月 Web 开发大版内专家分月排行榜第三
匿名用户不能发表回复!|不怨天,不尤人,下学而上达,知我者其天乎!
Unity打Android包报错总结
Failed to compile resources with the following parameters:
-bootclasspath "E:\software\Android\AndroidSDK_ForUnity5\platforms\android-24\android.jar" -d "D:\h5\UnityProjects\IceClimber\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "android\support\customtabs\R.java" "android\support\graphics\drawable\R.java" "android\support\graphics\drawable\animated\R.java" "android\support\v4\R.java" "android\support\v7\appcompat\R.java" "android\support\v7\cardview\R.java" "com\facebook\R.java" "com\facebook\android\R.java" "com\herofun\iceclimber\R.java"
可能是jdk版本低了,使用jdk8解决。
IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\app-debug\classes.jar' to 'Temp/StagingArea\android-libraries\app-debug\libs\classes.jar'.
UnityEditor.Android.PostProcessor.Tasks.ProcessAAR.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
UnityEditor.HostView:OnGUI()
删除aar中的libs/classes.jar
Error: [Temp\StagingArea\AndroidManifest-main.xml:12,&
D:\h5\UnityProjects\Test\AARTest\Temp\StagingArea\android-libraries\app-debug\AndroidManifest.xml:3]&
Main manifest has &uses-sdk android:minSdkVersion='9'& but library uses minSdkVersion='15'
UnityEditor.HostView:OnGUI()
在Unity的PlayerSetting中把minSdkVersion设成与第三方库中的minSdkVersion一致
CommandInvokationFailure: Failed to re-package resources.
E:\software\Android\AndroidSDK_ForUnity5\build-tools\24.0.1\aapt.exe package
&--auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I&
&"E:\software\Android\AndroidSDK_ForUnity5\platforms\android-25\android.jar"&
&-F bin/resources.ap_ --extra-packages com.zwwx.game.gamesupport -S&
&"D:\h5\UnityProjects\Test\AARTest\Temp\StagingArea\android-libraries\app-debug\res"
build-tools用的版本是24,platforms版本用的是android-25, 两个版本不一致导致报错。
使用platforms/android-24打包
CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.&
E:\software\Java\jdk8\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:\software\Android\AndroidSDK_ForUnity5\tools" -Dfile.encoding=UTF8 -jar "E:\software\Unity5_5\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
Warning: [Temp\StagingArea\AndroidManifest-main.xml:12,&
D:\h5\UnityProjects\Test\AARTest\Temp\StagingArea\android-libraries\app-debug\AndroidManifest.xml:3]&
Main manifest has &uses-sdk android:targetSdkVersion='23'& but library uses targetSdkVersion='25'
第三方库与Unity中用的SDK的targetSdkVersion版本不一致。
Unity使用targetSdkVersion='25'打包。
Android SDK升级到以下版本
platforms/android-25、tools_r25.2.5-windows、build-tools_r25.0.2-windows
注意:最新版本的tools下没有android.bat命令,打包会报Error:Invalid command android错误
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.&
E:\software\Java\jdk8\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:\software\Android\AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "E:\software\Unity5_5\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
Error:Invalid command android
新版本的tools下没有android.bat命令,所以打包时报Error:Invalid command android
下个旧版本的tools再打包。tools_r25.2.5-windows.zip
UnityException: Adding Android library projects failed!
UnityEditor.Android.AndroidLibraries.AddLibraryProject (System.String projectPropertiesPath)
UnityEditor.Android.AndroidLibraries.FindAndAddLibraryProjects (System.String searchPattern)
UnityEditor.Android.PostProcessor.Tasks.AddAndroidLibraries.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
aar中的某些文件被删除了,比如aar中的AndroidManifest.xml被删除了。
重新生成个aar
Error:Execution failed for task ':processReleaseGoogleServices'.
& No matching client found for package name 'com.zwwx.game.WinterJump'
原因:google-services.json中的包名与build.gradle中的包名不一致。
解决方案:改成一致就行了。
用gradle build打包时报以下错
To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at le
ast 1536 MB.
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environ
原因:gradle需要更大内存
解决方案: 修改gradle-wrapper.properties文件。
在gradle-wrapper.properties文件中添加一条配置
set& org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m
Parsing json file: D:\xxx\google-services.json
:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
& No matching client found for package name 'com.xx.xxx.xxxxx'
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
原因:google-services.json中定义的包名与AndroidManifest.xml中定义的包名不一致。
解决方案:包名改一致。
Rejecting re-init on previously-faile d class java.lang.Class&com.helpshift.support.adapters.QuestionListAdapter&: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/RecyclerView$A
解决方案: 删除libs下的android-support-v4.jar保留android-support-v7-appcompat.jar
Flash游戏设计:
Unity游戏设计:This page details the Player Settings specific to Android. For a description of the general Player Settings, see documentation on .
The Icon section of the Android PlayerSettings window
Set up textures for the Android Adaptive icons in your app.
Set up textures for the Android Round icons in your app.
Set up textures for the Android Legacy icons in your app.
Enable Android Banner
Enables a custom banner for Android TV builds.
Resolution And Presentation
The Resolution and Presentation section of the Android PlayerSettings window
Resolution and Presentation
Preserve framebuffer alpha
Enable Unity to render on top of native Android UI. The camera’s Clear Flags have to be set to Solid color with an alpha less than 1 for this to have any effect. (OpenGL ES only).
Resolution Scaling
Resolution Scaling Mode
This option can be used to render the scene on the target device at a resolution lower than screen resolution.
Render at full screen resolution.
Render at resolution potentially lower than screen resolution.
Target DPI
When Resolution Scaling Mode is set to Fixed DPI, this setting determines how much lower the target rendering resolution is going to be. The scale is calculated as min(Target DPI * Factor / Screen DPI, 1). Factor is controlled by .
Controls whether a blit is used to present the final image to the screen.
(Always blit) Make Unity render to an offscreen buffer and then copy to the system framebuffer. This is compatible with most devices, but is usually slower than Never blitting.
(Never blit) Make Unity render to the framebuffer provided by the OS. If a condition arises during application run time that causes this to fail, the application will print a one-time warning to the device log. Never blitting is usually faster than Always blitting, but it’s not compatible with all devices.
Make Unity render to the framebuffer provided by the OS, if possible. If a condition is met that prevents your application from rendering to the system framebuffer, the application switches to offscreen rendering and issues a warning to the device console.
Support Aspect Ratio
Aspect Ratio Mode
The aspect ratio for the device. Choose from: Legacy Wide Screen (1.86), Super Wide Screen (2.1) and Custom. When you select Custom, an Up To field appears. Use this to set a maximum screen width.
Orientation
Default Orientation
Set the application’s screen orientation.
Orient the screen so that the device’s Home button is at the bottom.
Portrait Upside Down
Orient the screen so that the device’s Home button is at the top.
Landscape Left
Orient the screen so that the device’s Home button is on the right-hand side.
Landscape right
Orient the screen so that the device’s Home button is on the left-hand side.
Allowed Orientations for Auto Rotation (Only visible when Default Orientation is set to Auto Rotation)
Allow portrait orientation.
Portrait Upside Down
Allow portrait upside-down orientation.
Landscape Right
Allow landscape right orientation (home button is on the left side).
Landscape Left
Allow landscape left orientation (home button is on the right side).
Use 32-bit Display Buffer
Specifies if the Display Buffer should be created to hold 32-bit color values (16-bit by default). Use it if you see banding, or need alpha in your , because they create
in the same format as the Display Buffer.
Disable Depth and Stencil
Tick this checkbox to disable the depth and stencil buffers.
Show Loading Indicator
The type of loading progress indicator that should be shown. Options are Don’t Show, Large, Inversed Large, Small and Inversed Small.
Splash Image
Virtual Reality Splash Screen
Specify the texture that should be used for the Android splash screen on a Virtual Reality application.
Android Splash Screen
Specify the texture that should be used for the Android splash screen. The standard size for the splash screen image is 320x480.
Splash Scaling
Specify how the splash image is scaled to fit the device’s screen. The options are Center (only scale down), Scale to Fit (letter-boxed) and Scale to Fill (cropped).
Other Settings
The Rendering section of the Android PlayerSettings window
Color Space
The Color Space used for your application. See
for more information.
Auto Graphics API
Check this to make Unity auto-select a graphics API from the Open Graphics Library (). When checked, Unity will try GLES3.1, and fall back to GLES3 or GLES2 if the device does not support GLES3.1. When unchecked, you can manually pick and reorder the graphics APIs. If only GLES3 is in the list, two a Require ES3.1 and Require ES3.1+AEP appear, allowing you to force the corresponding graphics API.
Important: GLES3/GLES3.1/AEP requirement is added to your Android manifest only if GLES2 is not in the list, and Minimum API Level is set to JellyBean (API level 18) or higher. In this case only, your application won’t show up on unsupported devices in Google Play Store.
Multithreaded Rendering
Check this box to move graphics API calls from Unity’s main thread to a separate worker thread. This can help to improve performance in applications that have high CPU usage on the main thread.
Static Batching
Check this box to use
on your build (enabled by default).
Dynamic Batching
Check this box to use
on your build (enabled by default).
GPU Skinning
Check this box to enable OpenGL ES 3 GPU skinning. To learn more about GPU skinning, see the . Note that this property only supports VR apps, and only works if the Virtual Reality Supported checkbox is ticked.
Graphics Jobs (Experimental)
Check this box to instruct Unity to offload graphics tasks (render loops) to worker threads running on other CPU cores. This is intended to reduce the time spent in
on the main thread. This feature is experimental. it may not deliver a performance improvement for your project, and may cause instabilities. Graphics Jobs are currently only supported when using
and the checkbox has no effect when using
Virtual Reality Supported
Enable this if your application is a virtual reality application, then add the required VR SDKs to the list.
Protect Graphics Memory
Check this box to force the graphics buffer to be displayed only through a hardware-protected path. Works only on devices which support it.
The Identification section of the Android PlayerSettings window
Identification
Package Name
The unique application ID, used to uniquely identify your app on the device and in Google Play Store. (Shared between iOS and Android.)
Specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The version is specified in the common format of a string containing numbers separated by dots (eg, 4.3.2). (Shared between iOS and Android.)
Bundle Version Code
An internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version n that number is set by the versionName attribute. The value must be set as an integer, such as “100”. You can define it however you want, as long as each successive version has a higher number. For example, it could be a build number. Or you could translate a version number in “x.y” format to an integer by encoding the “x” and “y” separately in the lower and upper 16 bits. Or you could simply increase the number by one each time a new version is released.
Minimum API Level
Minimum Android version (API level) required to run the application.
Target API Level
Target Android version (API level) against which to compile the application.
The Configuration section of the Android PlayerSettings window
Configuration
Scripting Runtime Version
Choose which .NET runtime to use in your project. For more details, see Microsoft’s .
.NET 3.5 Equivalent
A .NET runtime which implements the .NET 3.5 API. This is the default scripting runtime.
.NET 4.x Equivalent
A .NET runtime which implements the .NET 4 API. This API is newer than .NET 3.5, and as such, it offers access to more APIs, is compatible with more external libraries, and supports C# 6.
Scripting Backend
Select your scripting backend. There are two options: IL2CPP or Mono2x. The default is Mono2x.
Choose this to set ILC2PP as your scripting backend. See Unity documentation on
for more information.
Choose this to set Mono2x as your scripting backend. This is the default option. See
for more information.
API Compatibility Level
Specifies active .NET API profile. See below..Net 2.0:NET 2.0 libraries. Maximum .NET compatibility, biggest file sizes .Net 2.0 Subset: Subset of full .NET compatibility, smaller file sizes
Mute Other Audio Sources)
Stops or allows audio from other applications to play in the background while your Unity application is running. Enable this and your Unity application stops audio from background applications, disable this and audio from background applications continue to play alongside your Unity application.
Disable HW Statistics
By default, Unity Android applications send anonymous HW statistics to Unity. This provides you with aggregated information to help you make decisions as a developer. Find these statistics at . Check this option to stop Unity sending these statistics.
Target Architectures
Allows the application to run on the specified CPUs.
Install Location
Specifies application install location on the device (for detailed information, refer to .
Let the operating system decide. User will be able to move the app back and forth.
Prefer External
Install the application to external storage (SD card) if possible. The operating system d if not possible, the app will be installed to internal memory.
Force Internal
Force the application to be installed to internal memory. The user will be unable to move the app to external storage.
Internet Access
When set to Require, this adds the networking (INTERNET) permission to the , even if you are not using any networking APIs. This is enabled by default for development builds.
Write Access
When set to External(SDCard) , enables write access to the external storage such as the SD card and add a corresponding permission to the Android manifest. Enabled by default for development builds.
Sustained Performance Mode
Set a predictable and consistent level of device performance over longer periods of time, without thermal throttling. Overall, performance might be lower when this setting is enabled. Based on the .
Android TV Compatibility
Check this box to mark the application as Android TV compatible.
Android Game
Android TV - Check this box to mark the output package (APK) will as a game rather than a regular application.
Android Gamepad Support Level
Android TV - This option allows you to define the level of support your application offers for a gamepad. The options are Works with D-Pad, Supports Gamepad and Requires Gamepad.
Scripting Define Symbols
Custom compilation flags (see the
page for details).
The Optimization section of the Android PlayerSettings window
Optimization
Prebake Collision Meshes
Should collision data be added to meshes at build time?
Keep Loaded Shaders Alive
Check this box to prevent shaders from being unloaded.
Preload Shaders
Should shaders be loaded when the application starts up?
Preloaded Assets
An array of assets to be loaded when the application starts up.
Stripping Level
Options to strip out scripting features to reduce the output package (APK) size (This setting is shared between iOS and Android platforms, and is available with the Mono scripting backend only.)
No reduction is done.
Strip Assemblies
Level 1 size reduction.
Strip ByteCode (iOS only)
Level 2 size reduction (includes reductions from Level 1).
Use micro mscorlib
Level 3 size reduction (includes reductions from Levels 1 and 2).
Strip Engine Code
Enable code stripping. (This setting is only available with the
scripting backend.)
Enable Internal profiler
Check this box if you want to get the profiler data from your device in the Android SDK’s
output while testing your projects (only available in development builds).
Vertex Compression
Select which vertex channels should be compressed. Compression can save memory and bandwidth but precision will be lower.
Optimize Mesh Data
Remove any data from meshes that is not required by the material applied to them (tangents, normals, colors, UV).
Enable different logging types (see the
page for details).
API Compatibility Level
You can choose your Mono API compatibility level for all targets. Sometimes a 3rd party .NET DLL uses the APIs that are not included into the .NET compatibility level you would like to use. In order to investigate such cases, get a reflection tool like ILSpy on Windows, and check the dependencies of the DLLs.
Publishing Settings
Use Existing Keystore / Create New Keystore
Use this to choose whether to create a new Keystore or use an existing one. You can use the Browse Keystore button to select a Keystore from the filesystem.
Keystore password
Create a password for the Keystore.
Confirm password
Enter the same password you did in Keystore password (only enabled if the Create New Keystore option is selected).
Key alias.
Password for key alias.
Split Application Binary
Enable this option to split your output package into main (APK) and expansion (OBB) packages. This is required to publish applications larger than 100 MBytes to Goolge Play Store.
Note that for security reasons, Unity does not save the Keystore password or the Key password. Also, note that the signing must be done from Unity’s ,
does not work. The unsigned debug keystore is located by default at ~/.android/debug.keystore on MacOS and %USERPROFILE%.android\debug.keystore on Windows.
XR settings
XR Settings
Virtual Reality Supported
Enable native VR support for the Unity Editor and your game builds.
Enable use of Google’s
XR Support Installers
Vuforia Augmented Reality Supported
Enable use of the . You must have a Vuforia Software License and agree to the terms of that license before the property becomes enabled.
Bundle Identifier
The Bundle Identifier string is the unique name of your application when published to Google Play Store and installed on the device. The basic structure of the identifier is com.CompanyName.GameName, and can be chosen arbitrarily. In Unity this field is shared with the iOS Player Settings for convenience.
Stripping Level
Most games don’t use all the functionality of the DLLs included by default. With this option, you can strip out unused parts to reduce the size of the output package (APK).
Page amended with limited
Updated features in 5.5
Sustained Performance Mode added in 2017.3
.NET 4.x runtime added in 2018.1
Android Multiple APK features added in 2018.2
Did you find this page useful? Please give it a rating:
Single-Pass Stereo Rendering for Android
Android 2D Textures Overrides}

我要回帖

更多关于 unity打包安卓设置 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信