Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
iOS Guides
Installation

Installation

In order to build your app on a SmartDeviceLink (SDL) Core, the SDL software development kit (SDK) must be installed in your app. The following steps will guide you through adding the SDL SDK to your workspace and configuring the environment.

Note

The SDL SDK is currently supported on iOS 10.0 and above.

Install SDL SDK

There are four different ways to install the SDL SDK in your project: Carthage, CocoaPods, Swift Package Manager, or manually.

CocoaPods Installation

1. Xcode should be closed for the following steps.

2. Open the terminal app on your Mac.

3. Make sure you have the latest version of CocoaPods installed. For more information on installing CocoaPods on your system please consult: https://cocoapods.org.

sudo gem install cocoapods

4. Navigate to the root directory of your app. Make sure your current folder contains the .xcodeproj file.

5. Create a new Podfile.

pod init

6. In the Podfile, add the following text. This tells CocoaPods to install SDL SDK for iOS. SDL Versions are available on Github. We suggest always using the latest release.

target <#Your Project Name#>’ do
    pod SmartDeviceLink, ~> <#SDL Version#>’
end

7. Install SDL SDK for iOS:

pod install

8. There will be a newly created .xcworkspace file in the directory in addition to the .xcodeproj file. Always use the .xcworkspace file from now on.

9. Open the .xcworkspace file. To open from the terminal, type:

open <#Your Project Name#>.xcworkspace

Swift Package Manager Installation

You can install this library using the Swift Package Manager. You can install SDL into your iOS project using Xcode 12 by following these steps:

1. Open File -> Swift Packages -> Add Package Dependency...

2. Enter the URL https://github.com/smartdevicelink/sdl_ios.git into the search box.

3. Use the default rules or customize the rules to use a specific version or branch. This library added SPM support in version 7.0.0, so please use at least that version.

4. You will be asked which package project to use. If you are using a Swift project, then you should use the SmartDeviceLinkSwift project. If not, then you should use the SmartDeviceLink project. You can use the SmartDeviceLink project in a Swift project as well, but you will miss some Swift specific customizations, which are currently limited to logging enhancements.

5. In your SDL related code, use import SmartDeviceLink to call most SDL-related code. If you want to use the Swift-specific logging enhancements you must also use import SmartDeviceLinkSwift.

Carthage Installation

SDL iOS supports Carthage! Install using Carthage by following this guide.

Manual Installation

Tagged to our releases is a dynamic framework file that can be drag-and-dropped into the application.

Note

You cannot submit your app to the app store with the framework as is. You MUST strip the simulator part of the framework first.

You can check the architectures of your built framework like so:

lipo -info SmartDeviceLink.framework/SmartDeviceLink

Use a script like this to strip the simulator part of the framework.

lipo -remove i386 -remove x86_64 -o SmartDeviceLink.framework/SmartDeviceLink SmartDeviceLink.framework/SmartDeviceLink
View on GitHub.com
Next Section