This topic describes how to build the short video client for iOS.
Prepare the environment
Environment | Description |
System version | iOS 9.0 or later is supported. |
iPhone | iPhone 5 or later is supported. |
CPU architecture | The ARM64, ARMv7, and ARMv7s architectures are supported for physical devices. Simulator architectures are not supported. |
Xcode | Xcode 9.0 or later is supported. Download Xcode. |
Prerequisites
The short video AppServer is built and started. For more information, see Build the short video AppServer.
An Apple developer account is available.
Procedure
Download the short video demo and decompress the package. For more information, see SDK overview and download.
Directory structure:
- demo - |- AlivcCommon # The public component. - |- AlivcCore # The public component of the short video service. - |- AlivcCrop # The component that contains the code used to implement the cropping UI. - |- AlivcEdit # The component that contains the code used to implement the editing UI. - |- AlivcRecord # The component that contains the code used to implement the recording UI. - |- AlivcSmartVideo # The component of the short video service. - |- AliyunVideoClient_Entrance # The project entry file of the short video service. - doc # The related documentations. - sdk # The SDK that is used by the project. You can manually import an SDK as needed. - xxxReleaseNote.md # The release note.Import and configure the project.
Open Xcode and click Open a project or file. Then, double-click the AliyunVideoClient_Entrance.xcworkspace file in the demo directory.

Specify the server address.
File path: demo/AlivcCommon/AlivcCommon/Classes/Macro/AlivcDefine.m.
After you build the short video AppServer on an Elastic Compute Service (ECS) instance, set the
kAlivcQuUrlStringvariable in the file to the public IP address of the ECS instance followed by the port number 8080.Example: http://<Public IP address of the ECS instance>:8080.

Modify the Bundle Identifier and Signing Certificate parameters.
ImportantChange the Bundle Identifier parameter to
com.<Comany name>.<Project name>. This helps avoid running failures caused by registered bundle IDs.The value of the Bundle Identifier parameter must be defined in the package_name parameter in the profile of your short video AppServer. Assume that you do not set the Bundle Identifier parameter on the short video AppServer. When your application runs on the short video client for iOS, the bundle ID interceptor that is deployed on the short video AppServer intercepts the bundle ID of the application. As a result, a 403 error with the "Request failed:forbidden" error message is returned when the application sends a request to the short video AppServer. For more information about how to set the Bundle Identifier parameter on the short video AppServer, see Build the short video AppServer.
Modify the Bundle Identifier parameter on the General tab.
Modify the Signing Certificate parameter on the Sign & Capabilities tab.
On the Sign & Capabilities tab, select Automatically manage signing and set the Team parameter.
Select an account from the Team drop-down list.

If you do not have an account, click Add an Account to create one.

Create an account.

Select the created account from the Team drop-down list. Make sure that no error message appears after you add the signature.
Compile and run the project.
Select AlivcVoiceCallSoloClient as the target. Connect an iOS physical device to your computer by using a data cable. Select the physical device in Xcode, and then enable the developer mode in the system settings on the physical device.
Click build and run.
