Unity package docking XCode record

Since the company needs to send the software to the Apple Store, it started to pack the IOS package. The following is a record of the problems encountered during the packaging process. Save it for later viewing.


Software Environment

Windows side:

  • Win10
  • Unity 2019.2.9f1
  • TortoiseSVN

Mac side:

  • macOS big Sur 11.6
  • XCode 13.2.1
  • Cornerstone

At present, the process of exporting the Xcode project package from Unity on the Windows side, and then transferring it to the Mac side through SVN and then exporting the package is adopted.

The reference articles are as follows:


1. Record some settings of Unity and XCode

Note: The locations and names of some of the following configurations may change depending on the version of Unity and XCode.

Unity:
Scripting Backend:选 IL2CPP,因为需要支持 64 位,新版的 Unity 在切换成 XCode 时默认就是 IL2CPP
Api Compatibility Level:不要选子集,避免 dll 引用出问题
Auto Graphics API:不勾选,摒弃掉 matel 渲染,只留 OpenGLES2
Architerctures:修改为 Universal,表示同时支持 32 位,64 位架构

XCode:
Architerctures:设置为 Standard architectures,因为 32 位程序已经被苹果强制淘汰了
Capabilites->Background modes:设置问 ON,并勾选 remote notifications
Product->Scheme->Edit Scheme->run:将 “GPU Frame Capture” 设置为 Opengl ES
Build Settings->Enable Bitcode:设为 NO,否则所有第三方库都需要支持 bitcode

The following mainly records the related problems of XCode side

2. Library not found for -liPhone-lib problem

The "library not found" type of problems are caused by not finding the relevant lib references. The more likely situation is that there is a problem with the referenced address.
A common modification method is to enter Targets->Build Settings->Library Search Paths and “$(SRCROOT)/Librarie”remove the double quotes from $(SRCROOT)/Librarie.
insert image description here
But I used this method and it didn't work. Then I found the reference directory through the address listed in Library Search Paths. After comparing the folders with the same name on the Windows side and the Mac side, I found that the two lib files on the Windows side somehow did not have The upload was successful, so the two lib files did not exist on the Mac side.
After relabeling the files for upload and download, the problem was solved.

3、Command PhaseScriptExecution failed with a nonzero exit code 问题

Enter XCode's File->Project Setting
and adjust Shared Project Settings->Build System to Legacy Build System (Deprecated)
Although this has been said to be eliminated, but if you don't use this, you will report an error, and Xiaobai is very depressed.


So far, the problems during Build have been solved. But the following problem is that it cannot be directly released to the real machine for testing. (Of course, the real machine has been added to Apple's test models)

4. Xcode unable to install "packaged program name" problem

According to the method seen on the Internet:

Change Per-User Project Settings->Build System in File->Project Setting to Legacy Build System (Deprecated)

After this, I encountered a permission problem: Permission denied
The solution is: open the terminal and enter the command sudo chmod -R 777 project root directory

After some tossing, the result is still not resolved.
Finally saw this article .
The original text is as follows:

It is a very hot issue with the new update of Catalina. To be very precise the issue is with the manually signing of the provisioning profile. If you check Automatically manage signing it works.

In other words, check Automatically manage signing in Targets->Signing&Capabilities.
After using it I found this solution to the problem I was having.

5. About the choice of certificate

Improper selection of the certificate may result in failure to successfully deliver the package during real-device testing.
In the Build Settings tab in PROJECT and TARGETS, find the code signing identity option.
When debugging, it is uniformly selected as developer, and when it is released, it is uniformly selected as distribution.

The package was successfully delivered.


PS: What is recorded this time is only the relevant steps of separately producing the game iOS package, and if you need to add other plug-ins such as admob sdk to the project, the above steps 2 and 3 are not needed, but other various New actions and configurations.

Guess you like

Origin blog.csdn.net/EverNess010/article/details/123282187