This topic describes how to build the short video client for iOS.

Prerequisites

The following table describes the environment requirements for development.

Category 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 version Xcode 9.0 or later is supported. Download Xcode.

You must build and start the short video AppServer first. For more information, see Build the short video AppServer.

Procedure

  1. Download the short video demo and decompress the package. For more information about how to download the demo file for the short video client for iOS, see SDK 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.
  2. Import and configure the project.
    1. Open Xcode and click Open a project or file. Then, double-click the AliyunVideoClient_Entrance.xcworkspace file in the demo directory.
      Open
    2. 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 kAlivcQuUrlString variable 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.

      IP address
  3. Modify the Bundle Identifier and Signing Certificate parameters.
    Notice

    Set the Bundle Identifier parameter in the format of com. <Company name>. <Project name>. This helps avoid a running failure in scenarios where the bundle ID has been registered.

    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 parameter on the General tab
    Modify the Signing Certificate parameter on the Sign & Capabilities tab.Sign
  4. On the Sign & Capabilities tab, select Automatically manage signing and set the Team parameter.
    1. Select an account from the Team drop-down list.
      Select an account
    2. If you do not have an account, click Add an Account to create one.
      Add
    3. Create an account.
      Create an account
    4. Select the created account from the Team drop-down list. Make sure that no error message appears after you add the signature.
  5. Compile and run the project.
    1. 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.
    2. Click build and run.
    Compile