インストール
AIBuds SDK は CocoaPods で導入します。必要な機能が決まっていない場合は、まず完全インストールを選択してください。
動作要件
- iOS 13.0 以降
- Xcode 26.0 以降
- CocoaPods 1.16.0 以降
インストール方法を選択する
完全インストール
AIBudsSDK/AllInOne を使用して、デバイス接続、AI サービス、音声アシスタント、メディア、診断などの SDK コンポーネントをまとめて導入します。
モジュール別インストール
製品で使用する機能だけを選択します。必要な SDK レイヤーとサードパーティ依存関係は CocoaPods が自動的に導入します。
AI コーディングアシスタントで導入
インストール方法を選び、プロジェクトのワークスペースで短いプロンプトをアシスタントに貼り付けます。
AIBudsSDK/AllInOne で完全な SDK を導入します。
https://docs-aibuds.github.io/ja/skills/integrate-aibuds-sdk を読み、その指示に従ってください。AIBudsSDK/AllInOne をこの iOS プロジェクトに導入し、動作を検証してください。ステップ 1:Podfile に SDK を追加する
各 AIBudsSDK Pod の宣言には、Git の参照先:
:git => 'https://github.com/topstepsmart/AIBuds-SDK-iOS.git'またはローカルに配置した SDK のパスを指定します:
:path => '../AIBuds-SDK-iOS'以下の例では source の指定を省略しています。プロジェクトに合わせていずれかを追加してください。
- 完全インストール
- モジュール別インストール
platform :ios, '13.0'
target 'YourTargetName' do
pod 'AIBudsSDK/AllInOne'
endplatform :ios, '13.0'
target 'YourTargetName' do
# Device connectivity.
pod 'AIBudsSDK/ABMate'
# Choose one AI provider.
pod 'AIBudsSDK/AI/StarBurst'
# pod 'AIBudsSDK/AI/MltCloud'
# Add only the optional capabilities your product enables.
# pod 'AIBudsSDK/VoiceAssistant' # On-device voice assistant
# pod 'AIBudsSDK/LiveStream' # RTSP playback and RTMP streaming
# pod 'AIBudsSDK/VideoStabilization' # Imported six-axis video
# pod 'AIBudsSDK/FitCloudProOTA' # FitCloud Pro OTA devices
# pod 'AIBudsSDK/JieliOTA' # Jieli single-bank OTA devices
# pod 'AIBudsSDK/Log/XLFacility' # Persistent logs
# pod 'AIBudsSDK/AI/Dashboard' # Local AI diagnostics
# pod 'AIBudsSDK/CrashReporter' # Persisted crash reports
endモジュール一覧を表示
# Installing only AIBudsSDK selects Core.
# It does not include ABMate, an AI provider, or optional features.
pod 'AIBudsSDK'
# Base SDK types, Bluetooth orchestration, models, and protocols.
# Includes: Foundation, Log/Core
pod 'AIBudsSDK/Core'
# ABMate BLE device communication.
# Includes: Core, GCDWebServer, libopus
pod 'AIBudsSDK/ABMate'
# Shared audio-session and voice-activity processing for AI.
# Includes: Core, tenVad
pod 'AIBudsSDK/Audio'
# Core logging without the XLFacility backend.
# Includes: zipzap
pod 'AIBudsSDK/Log/Core'
# Persistent logging and local log-browser integration.
# Includes: Log/Core, iOSLogBrowserSDK
pod 'AIBudsSDK/Log/XLFacility'# Optional OTA protocol plugins. Install only the implementations required by
# your devices, then register each plugin before connecting a device.
pod 'AIBudsSDK/FitCloudProOTA'
pod 'AIBudsSDK/JieliOTA'# AI facade, sessions, reports, and provider routing.
# Includes: AI/Foundation, Core, WCDB.swift
pod 'AIBudsSDK/AI/Core'
# StarBurst AI services.
# Includes: AI/Core, Audio, StarBurst SDK, LAME, libopus, libogg
pod 'AIBudsSDK/AI/StarBurst'
# MLTCloud AI services.
# Includes: AI/Core, Audio, MagicHelper, Microsoft Speech, LAME, libopus, libogg
pod 'AIBudsSDK/AI/MltCloud'
# Local AI diagnostic dashboard.
# Includes: AI/Core, WCDB.swift, GCDWebServer, YYWebImage, iOSLogBrowserSDK
pod 'AIBudsSDK/AI/Dashboard'# On-device voice assistant authentication bridge.
# Includes: Core, MZEncryptSDK, OpenSSL
pod 'AIBudsSDK/VoiceAssistant'
# Persisted crash-report capture and access.
# Includes: CrashReporter framework
pod 'AIBudsSDK/CrashReporter'
# Native RTSP playback and RTMP streaming.
# Includes: Log, FFmpeg, LiveStream resource bundle
pod 'AIBudsSDK/LiveStream'
# Post-processing for imported six-axis video.
# Includes: Core, bundled AWEISIMG implementation
pod 'AIBudsSDK/VideoStabilization'複数機能をまとめた subspec# Log/Core + Log/XLFacility
pod 'AIBudsSDK/Log'
# AI/Foundation + AI/Core + both providers + AI/Dashboard
pod 'AIBudsSDK/AI'
# Log + ABMate + FitCloudProOTA + JieliOTA + AI + VoiceAssistant
# + CrashReporter + LiveStream + VideoStabilization
pod 'AIBudsSDK/AllInOne'
# Do not normally select these implementation layers directly:
# AIBudsSDK/Foundation
# AIBudsSDK/AI/Foundation
# AIBudsSDK/ThirdParty/*
ステップ 2:必要な Podfile hook を追加する
次のブロックを Podfile に一度だけ追加します。必要な dynamic framework の設定、未対応の private header import の削除、バイナリ配布との互換性設定を行います。
dynamic_frameworks = ['AFNetworking', 'WCDB.swift', 'WCDBOptimizedSQLCipher', 'SocketRocket']
pre_install do |installer|
installer.pod_targets.each do |pod|
if dynamic_frameworks.include?(pod.name)
def pod.static_framework?; false; end
def pod.build_type; Pod::BuildType.dynamic_framework; end
end
end
end
def patch_private_header(installer, pod_subdir_pairs)
pod_subdir_pairs.each do |pod_name, sub_dir|
target_dir = sub_dir ? File.join(installer.sandbox.pod_dir(pod_name), sub_dir) : installer.sandbox.pod_dir(pod_name)
puts target_dir
next unless Dir.exist?(target_dir)
private_header_import = '#import <netinet6/in6.h>'
Dir.glob(File.join(target_dir, '**', '*.{h,m}')).each do |file_path|
puts file_path
next unless File.exist?(file_path)
file_content = File.read(file_path)
next unless file_content.include?(private_header_import)
original_mode = File.stat(file_path).mode
File.chmod(original_mode | 0o200, file_path)
File.write(file_path, file_content.gsub(private_header_import, ''))
File.chmod(original_mode, file_path)
puts "patched #{pod_name} private header import: #{File.basename(file_path)}"
end
end
end
post_install do |installer|
patch_private_header(installer, {'AFNetworking' => 'AFNetworking', 'Reachability' => nil })
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
endステップ 3:インストールして workspace を開く
CocoaPods を実行し、.xcodeproj ではなく生成された workspace を開きます:
pod install
open YourProject.xcworkspaceステップ 4:権限を追加する
デバイス接続に必要な権限
Info.plist に 2 つの Bluetooth 使用目的を追加します:
<key>NSBluetoothWhileInUseUsageDescription</key>
<string>Your app needs Bluetooth access while in use to connect to AIBuds devices.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Your app needs Bluetooth access to communicate with AIBuds devices.</string>いずれかの Bluetooth key がない場合、AIBudsSDK.initialize は false を返します。
使用する機能に応じて追加する項目
| 機能 | 追加設定 |
|---|---|
| iPhone 側での音声収録 | マイクの使用目的 |
| ライブ配信、Camera OTA、またはデバイスの hotspot を使用するメディア取得 | ローカルネットワークの使用目的、Bonjour service、Access WiFi Information、Hotspot Configuration |
| バックグラウンドでの Bluetooth または AI 対話 | 使用する動作に対応する Background Modes |
任意の権限と entitlement の設定例を表示
マイク<key>NSMicrophoneUsageDescription</key>
<string>Your app needs microphone access for simultaneous interpretation and conversation translation.</string>
ローカルネットワークと Bonjour<key>NSLocalNetworkUsageDescription</key>
<string>Your app needs local network access to stream live video, perform device updates, and download recordings and photos.</string>
<key>NSBonjourServices</key>
<array>
<string>_dummy._tcp</string>
</array>
バックグラウンドモード<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>push-to-talk</string>
<string>audio</string>
</array>
Hotspot の entitlement
アプリターゲットの Signing & Capabilities で Access WiFi Information と Hotspot Configuration を有効にします:<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.networking.HotspotConfiguration</key>
<true/>
ステップ 5:インストールを確認する
- 生成された
.xcworkspaceをビルドします。 - ターゲットから導入した AIBuds framework をインポートできることを確認します。
- 必須の Bluetooth key を追加した後、
AIBudsSDK.initializeがtrueを返すことを確認します。 - クイックスタートに進み、SDK を初期化してデバイスに接続します。
インストールまたは初期化に失敗した場合は、Pod の cache や lockfile を変更する前に、よくある問題の確認手順を実行してください。