Building for iOS/iPadOS
This guide will walk you through the process of installing Convai-powered Unity applications on iOS and iPadOS devices.
Prerequisites
Before you begin, make sure you have the following:
Unity 2022.3 or later
Xcode (latest version recommended)
Apple Developer account
Project with Convai's Unity SDK integrated and running properly
MacBook for building and deploying to iOS/iPadOS
Step 1: Prepare Your Unity Project
Open your Convai-powered Unity project.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FMpYJ6hSsdjDj1NSb1jpa%252Fimage.png%3Falt%3Dmedia%26token%3Dbac7f173-232c-4e41-8008-115133670130&width=768&dpr=4&quality=100&sign=3b7a102f&sv=1)
Step 2: Configure Build Settings
In Unity, go to
File
→Build Settings
.Select
iOS
as the target platform.Click
Switch Platform
if it's not already selected.Check the
Development Build
option for testing purposes.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FPBhESVv5EuehojOyIKfs%252Fimage.png%3Falt%3Dmedia%26token%3D4646c133-44fb-4451-b07f-2f9fa1e042cd&width=768&dpr=4&quality=100&sign=9806fa88&sv=1)
If you wish to add a few required files manually, follow step 3. If you want it to be done automatically, jump to step 4
Step 3: Manually add Required Files
Add link.xml
Create a new file named
link.xml
in your project'sAssets
folder.Add the following content to the file:
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252F32cMXNWVguFd4bpqYjXd%252Fimage.png%3Falt%3Dmedia%26token%3D2b6e096b-1e40-4389-8710-49a5d6df16f8&width=768&dpr=4&quality=100&sign=fe4ae6c4&sv=1)
This file prevents potential FileNotFoundException
errors related to the libgrpc_csharp_ext.x64.dylib
file.
Add BuildIos.cs Script
Create a new C# script in
Assets/Convai/Scripts
namediOSBuild.cs
.Add the following content to the script:
Step 4: Install required gRPC dlls for iOS:
Go to Convai -> Custom Package Installer
Click on
Install iOS Build Package
Attach the script
iOSBuild.cs
to any GameObject in your scene.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FC2fzpQrwZ3EvuR0DBotS%252Fimage.png%3Falt%3Dmedia%26token%3D50493030-141d-4a90-a066-a6f668dcdd61&width=768&dpr=4&quality=100&sign=c6b209aa&sv=1)
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FGFHIyd8DnRu0GmaBrSgl%252Fimage.png%3Falt%3Dmedia%26token%3D48743123-c3c3-4df0-aa57-474c6880575b&width=768&dpr=4&quality=100&sign=bb24d37a&sv=1)
Step 5: Build the Xcode Project
In Unity, go to
File
→Build Settings
.Click
Build
and choose a location to save your Xcode project.Wait for Unity to generate the Xcode project.
Step 6: Configure and Build in Xcode
Open the generated Xcode project.
In Xcode, select your project in the navigator.
Select your target under the "TARGETS" section.
Go to the "Signing & Capabilities" tab.
Ensure that "Automatically manage signing" is checked.
Select your Team from the dropdown (you need an Apple Developer account for this).
If needed, change the Bundle Identifier to a unique string.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FRae225NRwsNBGbrmvCxz%252Fimage.png%3Falt%3Dmedia%26token%3D39621bda-7a5f-4205-bba2-34e1baed1067&width=768&dpr=4&quality=100&sign=e4577a16&sv=1)
Step 7: Build and Run
Connect your iOS device to your Mac.
In Xcode, select your connected device as the build target.
Click the "Play" button or press
Cmd + R
to build and run the app on your device.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252Fi4HyZ4OkxjhbNUQORU8Q%252Fimage.png%3Falt%3Dmedia%26token%3Dd60995b2-e126-48dc-bd2d-d51f744e668b&width=768&dpr=4&quality=100&sign=3aba2327&sv=1)
Troubleshooting
If you encounter any build errors, ensure all the steps above have been followed correctly.
Check that your Apple Developer account has the necessary provisioning profiles and certificates.
If you face any GRPC-related issues, verify that the
libgrpc_csharp_ext.a
andlibgrpc.a
files are correctly placed in theAssets/Convai/Plugins/gRPC/Grpc.Core/runtime/ios
folder.
![](https://docs.convai.com/~gitbook/image?url=https%3A%2F%2F413558230-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEtUJA212Zc1S9ACc8T4l%252Fuploads%252FcVajsSKbBkNwmgB2J1NN%252Fimage.png%3Falt%3Dmedia%26token%3Dfd542966-6d91-4db4-82f5-26f018b0adc3&width=768&dpr=4&quality=100&sign=fa9a5949&sv=1)
Conclusion
You should now have successfully installed your Convai-powered Unity app on your iOS or iPadOS device. If you encounter any issues or need further assistance, please visit our discord channel or contact Convai support.
Last updated