# Compile and run a sample project (/en/realtime-media/rtc/build/join-and-manage-channels/compile-run-sample-project/ios)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Agora provides [Open-source sample projects on GitHub](https://github.com/AgoraIO/API-Examples/tree/main) to demonstrate the implementation of basic and advanced RTC SDK features.

This page shows how to compile, configure, and run the RTC SDK iOS sample project.

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
## Prerequisites

      
  
      
  
      
* Xcode 13.0 or higher.
* An Apple developer account.
* If you need to use CocoaPods integrated SDK, make sure [CocoaPods is installed](https://guides.cocoapods.org/using/getting-started.html#getting-started).
* Two devices running iOS 14.0 or higher.

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
{ /*
  - If a firewall is deployed in your network environment, refer to [Connect through restricted networks with Cloud Proxy](/en/realtime-media/rtc/manage-agora-account) to use Agora services normally.
  */ }

* A camera and a microphone

* A valid Agora account and project. Please refer to [Agora account management](/en/realtime-media/rtc/manage-agora-account) for details.

* Installed [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

## Project setup

      
  
      
  
      
  
      
  
      
### Get the sample project

You can obtain the sample project using the following methods:

* Go to the [SDKs](/sdks) page, download the latest version of the Agora RTC SDK, and unzip it.

* Run the following command to clone the Github repository locally:

  ```bash
  git clone git@github.com:AgoraIO/API-Examples.git
  ```

  This repository contains sample projects for all native platforms of Agora RTC SDK. The examples for iOS are located under `/iOS`.

  | Path                    | Description                             |
  | ----------------------- | --------------------------------------- |
  | `/iOS/APIExample`       | API usage examples for Agora RTC SDK.   |
  | `/iOS/APIExample-Audio` | API usage examples for Agora Voice SDK. |

### Configure the sample project

<CalloutContainer type="warning">
  <CalloutTitle>
    information
  </CalloutTitle>

  <CalloutDescription>
    This page refers to the video sample project. If you want to run the audio sample project, refer to the following steps and operate in the audio folder.
  </CalloutDescription>
</CalloutContainer>

1. Open the `samples/APIExample/APIExample/Common/KeyCenter.swift` file and fill in the App ID and App certificate you obtained from the Agora Console.

   ```swift
   class KeyCenter: NSObject {
       // Replace <#Your App ID#> with your App ID
       static let AppId: String = "<#Your App ID#>"
       // Replace #Your certificate# with your App certificate. Leave this field blank if the project allows joining with the App ID only.
       static let Certificate: String? = "<#Your certificate#>"
   }
   ```

2. Open terminal and run `pod install` in the `samples/API-Example` folder to install the SDK and related dependencies. After the installation is complete, the terminal displays 'Pod installation complete!'.

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
## Run the sample project

      
  
      
  
      
  
      
  
      
1. Connect an iOS device to your development machine, open **Device > Privacy & Security > Security** on the device, and turn on the developer mode.

2. Check your iOS device in the **iOS Device** options at the top of the Xcode interface.

   ![](https://assets-docs.agora.io/images/video-sdk/run-compile-ios-step-2.png)

3. Check **Automatically manage signing** in **Signing & Capabilities** under **TARGETS**, then configure your Apple developer account and **Bundle Identifier** under each target.

   ![](https://assets-docs.agora.io/images/video-sdk/run-compile-ios-step-3.png)

4. Click **Start compiling**.

5. After successful compilation, you see the app icon on your device.

6. If an untrusted developer prompt pops up on the device, first tap **Cancel** to close the prompt, then open **Settings > General > VPN and Device Management** on the iOS device, and choose to trust the developer.

7. Open the **API Example App**, select an example you want to try, then enter the channel name. For example, *test*, and tap **Join Channel**.

8. To test various audio and video interaction use-cases, connect to the [Agora web demo](https://webdemo.agora.io/basicVideoCall/index.html), or install and run the sample project on a second device. Make sure you use the same app ID on both devices. When you join the same channel from two devices, you can see and hear each other.

   ![](https://assets-docs.agora.io/images/video-sdk/run-compile-ios-step-8.png)

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
