---
description: Get your hands on the real experience with the demo application
---

# Try out the demo app

## General

To get a better idea of the system, we suggest setting up and building a test iOS application, and then see the results of its work in the Management Console.

You can get the latest demo Xcode project from the repository:

{% embed url="https://github.com/AnchorFreePartner/caketubesdk-demo-ios" %}

{% hint style="info" %}
Instructions from the README file can be omitted, since they have already been implemented in the latest version of the project
{% endhint %}

After you open the project in the Xcode, locate the _AppDelegate.swift_ file and fill the "**carrierId**" variable with the value of **ProjectID** for your project:

```
CakeTube.instance().configure(CTConfig.create { (c) in
            c.baseUrl = "https://backend.northghost.com"
            c.carrierId = ""
            c.vpnProtocol = .ikEv2
            c.vpnProfileName = "CakeTubeSDK App"
        })
```

You can find the **ProjectID** value in the upper right corner of the Management Console, below the project name

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-91af87394681f0274277eed8deac661ddd02727a%2FScreenshot%202021-06-08%20at%2019.28.14.png?alt=media)

{% hint style="warning" %}
ProjectID is set on the project creation form and cannot be changed after that
{% endhint %}

Build the project and run it in the simulator. The running application should look like this:

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-708bef083961ea9fda2cc20f103b72fcc15c244f%2FScreenshot%202021-06-08%20at%2017.26.43.png?alt=media)

{% hint style="warning" %}
Be aware that simulation of iOS device does not support opening of the VPN sessions and is limited to log in function
{% endhint %}

Try to log in by clicking the respective button and take a look on the **Users** page of the Management Console:

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-9ddf157b04922213a83ca9368d3a96dbd5dea66f%2FScreenshot%202021-06-08%20at%2017.09.35.png?alt=media)

You can get a detailed information on the test user by clicking on the row:

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-6ddd3694bd6535a4b864a9ca57168d9c89f57549%2FScreenshot%202021-06-08%20at%2017.09.45.png?alt=media)

As you can see, the demo app successfully established connection with the oAuth server and acquired an access token:

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-2a999e66156588891ffc29c084a95c6212fd550c%2FScreenshot%202021-06-08%20at%2017.10.01.png?alt=media)

## Possible issues

* Due to the fact that Xcode and iOS versions are constantly updated, an error may occur:

> Building for iOS Simulator, but the linked and embedded framework was build for iOS + iOS Simulator

This problem can be fixed by setting the following value for the parameter "**Validate Workspace**" in the "**Build settings**" section of the _target_:

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-e6a1ed290c875298e6099852a99c3c2404144830%2FScreenshot%202021-06-08%20at%2014.26.51.png?alt=media)

* If you are building the project on the M1 Apple Silicon, you can also get another error:

> Building for iOS Simulator, but linking in dylib built for iOS

In order to fix it, you will need to add "**arm64"** into the "**Excluded Architecture**" of target's **Build settings**

{% hint style="info" %}
It would probably be missing in the list, you need to type it in
{% endhint %}

![](https://3437387582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M57yuAWriRSwZHosffd%2Fuploads%2Fgit-blob-b2f721e30459b0ef7258f956430ce66abac55af9%2FScreenshot%202021-06-08%20at%2014.27.21.png?alt=media)
