136 lines
6.7 KiB
Markdown
136 lines
6.7 KiB
Markdown
|
---
|
|||
|
title: IOS&Android Package
|
|||
|
date: 2023-05-05 10:59:01
|
|||
|
excerpt:
|
|||
|
tags:
|
|||
|
rating: ⭐
|
|||
|
---
|
|||
|
|
|||
|
# 命令行
|
|||
|
## Win
|
|||
|
```bash
|
|||
|
cd D:/UnrealEngine/UnrealEngine4_YueHua/Engine/Build/BatchFiles /d
|
|||
|
|
|||
|
RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:GameConfigurations=Development;Shipping -set:WithFullDebugInfo=false -set:HostPlatformEditorOnly=false -set:AnalyticsTypeOverride= -set:HostPlatformDDCOnly=true -set:WithWin64=true -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxArm64=false -set:CompileDatasmithPlugins=false -set:WithServer=false -set:WithClient=false -set:WithHoloLens=false -clean
|
|||
|
```
|
|||
|
|
|||
|
## Android
|
|||
|
```bash
|
|||
|
cd D:/UnrealEngine/UnrealEngine4_YueHua/Engine/Build/BatchFiles /d
|
|||
|
|
|||
|
RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:GameConfigurations=Development;Shipping -set:WithFullDebugInfo=false -set:HostPlatformEditorOnly=false -set:AnalyticsTypeOverride= -set:HostPlatformDDCOnly=false -set:WithWin64=true -set:WithMac=false -set:WithAndroid=true -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxArm64=false -set:CompileDatasmithPlugins=false -set:WithServer=false -set:WithClient=false -set:WithHoloLens=false
|
|||
|
|
|||
|
RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:WithFullDebugInfo=false -set:HostPlatformEditorOnly=false -set:AnalyticsTypeOverride= -set:HostPlatformDDCOnly=false -set:WithWin64=true -set:WithMac=false -set:WithAndroid=true -set:WithIOS=false -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxArm64=false -set:CompileDatasmithPlugins=false -set:WithServer=false -set:WithClient=false -set:WithHoloLens=false
|
|||
|
```
|
|||
|
|
|||
|
```
|
|||
|
RunUAT Turnkey -command=Verifysdk -platform=Android
|
|||
|
```
|
|||
|
|
|||
|
## MAC
|
|||
|
```bash
|
|||
|
cd ./Desktop/UnrealEngine/Engine/Build/BatchFiles
|
|||
|
./RunUAT.sh BuildGraph -target="Make Installed Build MAC" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:SignExecutables=false -set:EmbedSrcSrvInfo=false -set:GameConfigurations=Development;Shipping -set:WithFullDebugInfo=false -set:HostPlatformEditorOnly=true -set:AnalyticsTypeOverride= -set:HostPlatformDDCOnly=false -set:WithWin64=false -set:WithMac=true -set:WithAndroid=false -set:WithIOS=true -set:WithTVOS=false -set:WithLinux=false -set:WithLinuxArm64=false -set:CompileDatasmithPlugins=false -set:WithServer=false -set:WithClient=false -set:WithHoloLens=false -clean
|
|||
|
```
|
|||
|
|
|||
|
# MAC&IOS
|
|||
|
## Windows
|
|||
|
安装环境:
|
|||
|
- iTunes 12.10.11.2:不安装,IOS SDK就无法检测到。
|
|||
|
|
|||
|
文档:
|
|||
|
- Building for iOS on Windows:[https://docs.unrealengine.com/5.1/en-US/building-ios-projects-on-windows-in-unreal-engine/](https://docs.unrealengine.com/5.1/en-US/building-ios-projects-on-windows-in-unreal-engine/)
|
|||
|
- Provisioning Profiles and Signing Certificates:[https://docs.unrealengine.com/5.1/en-US/setting-up-ios-tvos-and-ipados-provisioning-profiles-and-signing-certificates-for-unreal-engine-projects/](https://docs.unrealengine.com/5.1/en-US/setting-up-ios-tvos-and-ipados-provisioning-profiles-and-signing-certificates-for-unreal-engine-projects/)
|
|||
|
|
|||
|
### GenerateProjectFiles跳过SDK问题
|
|||
|
运行GenerateProjectFiles.bat时,提示:
|
|||
|
>Some Platforms were skipped due to invalid SDK setup: Mac, IOS, Android, Linux, LinuxArm64, TVOS.
|
|||
|
|
|||
|
查看`Engine\Programs\UnrealBuildTool`目录下的`Log_GPF.txt`
|
|||
|
```
|
|||
|
Note: Android toolchain NDK r25b recommended
|
|||
|
Registering build platform: Android - buildable: False
|
|||
|
Registering build platform: UnrealBuildTool.IOSPlatformFactory
|
|||
|
Registering build platform: IOS - buildable: False
|
|||
|
Registering build platform: UnrealBuildTool.LinuxPlatformFactory
|
|||
|
Registering build platform: Linux - buildable: False
|
|||
|
Registering build platform: LinuxArm64 - buildable: False
|
|||
|
Registering build platform: UnrealBuildTool.MacPlatformFactory
|
|||
|
Registering build platform: Mac - buildable: False
|
|||
|
Registering build platform: UnrealBuildTool.TVOSPlatformFactory
|
|||
|
Registering build platform: TVOS - buildable: False
|
|||
|
Registering build platform: UnrealBuildTool.WindowsPlatformFactory
|
|||
|
Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (1)
|
|||
|
Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (2)
|
|||
|
```
|
|||
|
|
|||
|
- 问题原因
|
|||
|
- 安装Itunes太新或者没有安装itunes。
|
|||
|
- 解决方法
|
|||
|
- 卸载**itunes**以及**Apple Mobile Device Support**。之后安装12.10.11.2版本的**itunes**。
|
|||
|
|
|||
|
### SSH登录设置
|
|||
|
MAC
|
|||
|
Apple
|
|||
|
|
|||
|
ssh bluerose@192.168.2.164
|
|||
|
ECDSA key fingerprint is SHA256:fkRVqfbPPmbLUB4dn3QRFpATQykuu1AtlWmNLMSDXtU.
|
|||
|
|
|||
|
SSH还需要生成秘钥文件之后放置在对应文件夹里
|
|||
|
|
|||
|
### 证书与BaseEngine.ini
|
|||
|
证书需要后缀名为p12的证书,可以通过MAC的钥匙串进行转换。具体操作为:
|
|||
|
1. 选择想要导出的证书,右键点击导出。
|
|||
|
2. 选择p12类型
|
|||
|
3. 不要设置密码。
|
|||
|
|
|||
|
可以参考:https://blog.51cto.com/u_15318120/3241489
|
|||
|
>. cer证书只包含公钥,p12证书可能同时包含公钥和私钥。这就是他们的区别,除了xcode开发工具,打包都需要p12。
|
|||
|
|
|||
|
需要通过编辑器先在`Platform-IOS`先导入一次证书,通过后再把DefaultEngine.ini中的IOS设置加入到BaseEngine.ini中。
|
|||
|
|
|||
|
比如:
|
|||
|
DefaultEngine.ini
|
|||
|
```ini
|
|||
|
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
|||
|
BundleDisplayName=eto
|
|||
|
BundleName=eto
|
|||
|
BundleIdentifier=cn.tectree.eto
|
|||
|
MobileProvision=eto.mobileprovision
|
|||
|
SigningCertificate=iPhone Developer: xiangtian luo (RD2564LPA4)
|
|||
|
```
|
|||
|
|
|||
|
BaseEngine.ini
|
|||
|
```ini
|
|||
|
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
|||
|
BundleDisplayName=etoBundleName=eto
|
|||
|
BundleIdentifier=cn.tectree.eto
|
|||
|
MobileProvision=eto.mobileprovision
|
|||
|
SigningCertificate=iPhone Developer: xiangtian luo (RD2564LPA4)
|
|||
|
```
|
|||
|
|
|||
|
## MAC
|
|||
|
![[安装Mac UE开发环境]]
|
|||
|
|
|||
|
# Android
|
|||
|
UE5.1为准的安装环境:
|
|||
|
- Android Studio 4.0
|
|||
|
- Android Cmd line tool 8.0
|
|||
|
- Android NDK r25b
|
|||
|
- Android SDK
|
|||
|
- Recommended: SDK 32
|
|||
|
- Minimum for compiling UE: SDK 30
|
|||
|
|
|||
|
具体步骤参考:https://docs.unrealengine.com/5.1/en-US/how-to-set-up-android-sdk-and-ndk-for-your-unreal-engine-development-environment/
|
|||
|
因为打包Android时一定会运行**Extra/SetupAndroid.bat**,所以需要完全按照文档步骤进行操作,比如:
|
|||
|
- 使用Android Studio4.0
|
|||
|
- 使用默认的安装位置。
|
|||
|
|
|||
|
设置完之后需要运行`GenerateProjectFiles.bat`并且编译一下。
|
|||
|
|
|||
|
|
|||
|
# 插件构建
|
|||
|
```bash
|
|||
|
cd D:\UnrealEngine\UE_5.2\Engine\Build\Batchfiles
|
|||
|
RunUAT.bat BuildPlugin -plugin="D:\UnrealEngine\Project\Plugins\MultiDraw\Plugins\MultiDraw\MultiDraw.uplugin" -package="D:\MultiDraw"
|
|||
|
```
|