ZegoAvatar SDK: Create your own Avatar
Tags: sdk, dev, avatar
Published: 2022-11-25 10:17:25

The metaverse and virtual reality allow us to redesign our reality or recreate our image as we prefer. As many of you know, it’s essential [to create your own Avatar](https://www.zegocloud.com/blog/create-an-avatar) for navigating many virtual places.

## ZegoAvatar SDK for Custom Avatar Creation

We now introduce the most powerful and innovative tool to create your own Avatar. It is the new ZegoAvatar SDK developed by ZEGOCLOUD.

Its undoubted quality lies in its powerful avatar customize capabilities, which take avatar customization to a new level. Try the ZegoAvatar [demo app](https://www.zegocloud.com/demo-apps) to create your virtual self and see how easy it is by just facing your camera.

If you are a developer or passionate about these topics and want to try to integrate ZegoAvatar SDK, then this section is for you. Let’s go through this tutorial together.

Make sure to have a ZEGOCLOUD account first, so [sign here](https://console.zegocloud.com/account/signup). You can use it for this free trial or anytime you want to integrate features or build real-time engagement into your apps using ZEGOCLOUD products.

The SDK is available for multiple platforms and systems. Let’s pick iOS now.

Create project
After logging in to your ZEGOCLOUD account, the first step is creating a project. It’s essential for app creation, where we define many parameters for our project.

1. Launch Xcode

Launch Xcode and select Create a new Xcode project or File → New → Project. Another window will open; select the iOS application (in this example, we decided to try the iOS platform). Select Application → App, and click Next.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fgidwvrvzomr7is9r7c.png)

2. Add a product name and an organization identifier.

These details are essential to our application. They act as bundle identifiers that uniquely identify our app throughout the system. After entering the necessary information, click on “Next.”

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nndzq82y4ory8ys17iai.png)

After clicking on “Next,” select the project storage path, and click “Create” to create the project.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/loftjwbtijy793jimiq5.png)

**Import SDK**
To import the Avatar customizer, follow these steps:

1. Download the SDK

Download and install the ZegoAvatar SDK. You will find it on the [SDK download](https://docs.zegocloud.com/article/14620). The page is generic, like the image below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uu8cypp5abnyi6msgl4t.png)

After downloading the File, you can see that it’s compressed. Decompress the package to extract all the SDK’s files.

2. Adding the SDK Library to the project directory

The first library file you need to add is the dynamic library file ZegoAvatar.xcframework. It’s easy, to copy the File manually to the project’s directory. To further simplify: Open Xcode, select **File **→ Add Files to [Project Name], and add the SDK Library file to the project.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s77yw2wi9zz64rwcbk8b.png)

3. TARGETS Configurations

The TARGETS specify a product containing the instructions for building the product from a set of files in a project. You will use TARGETS to point to customize avatar creation projects and instructions from our SDK Library file.

Below are some Target configurations needed for the project:

Select Targets → General → Frameworks, Libraries, and Embedded Content, add ZegoAvatar.xcframework, and set Embed to Embed & Sign.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/us3wd7l3asm3n8pq9cbe.png)

Select TARGETS → Build Settings, → Build Options, and set Enable Bitcode to NO.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/857gnfc2dgkzhggu5lqk.png)

4. Set Permission

Permission is needed to access device resources, like the camera and storage. This can be done through the following steps:

Select TARGETS → Info → Custom iOS Target Properties.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mw8rsrcfxlx335vhym5.png)

Click the plus icon (+) and add the camera and microphone permissions: We’ll use the camera to capture facial expressions using the mirroring feature [Privacy - Camera Usage Description]. and a microphone will be used for speech simulation [Privacy - Microphone Usage Description]

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5rg3988vf7gf8za5vxe.png)

**Import resource packages**
To use the AI capabilities the ZegoAvatar SDK provides, you must import the corresponding resource packages. Visit the SDK Downloads page to get the needed resource packages.

You can import these packages in two ways: “dynamic downloading” or the “added from local” method.

Follow the steps below to import packages:

Locate the assets folder, and drag the folder into your project folder.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2xlzhigd3qf6rbntkf8.png)

. A dialogue box will appear after dropping the package folder into your project. Select Create folder references to add the folder


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azvbakqer3lwkvu9v8u1.png)

Your folder structure will change and look like the one below. This shows that the following assets: AIModel.bundle, base.bundle, and Packages have been added to project directory.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0sstpdfievic05j3na59.png)

Congratulations, you are done integrating the ZegoAvatar SDK.

Time to create your own Avatar with the unique customized options you have. If you need guidance on how to use the ZEGOCLOUD Avatar maker, c[onsult this guide](https://www.zegocloud.com/blog/custom-avatar) at the voice ‘How to create a custom Avatar‘.

Follow [ZEGOCLOUD blog](https://www.zegocloud.com/blog) for more tutorials, news, and product updates.