iOS Bluetooth/WiFi setup automation for Dala.
This module provides automated setup for iOS Bluetooth and WiFi functionality by configuring the Xcode project with required files, frameworks, and Info.plist entries.
Usage
From the command line (via Mix task):
mix dala.setup_ios_bluetooth
mix dala.setup_ios_bluetooth --checkFrom Elixir code:
Dala.Setup.IOS.setup_bluetooth()
Dala.Setup.IOS.setup_bluetooth("/path/to/ios/directory")
Dala.Setup.IOS.check("/path/to/ios/directory")What it does
- Finds the Xcode project or workspace in the ios/ directory
- Adds Bluetooth files to the Xcode project:
- DalaBluetoothManager.h
- DalaBluetoothManager.m
- DalaBluetoothCInterface.m
- DalaBluetooth.swift
- Links CoreBluetooth.framework
- Adds required keys to Info.plist:
- NSBluetoothAlwaysUsageDescription
- NSBluetoothPeripheralUsageDescription
- NSLocalNetworkUsageDescription
- NSBonjourServices
- UIBackgroundModes (bluetooth-central)
- Patches AppDelegate to call DalaBluetoothBridge.ensureLinked()
- Verifies the setup
Prerequisites
- Xcode project must exist in the ios/ directory
- Ruby is preferred (for pbxproj modification); sed fallback if unavailable
- plutil or PlistBuddy must be available (for Info.plist modification)
Summary
Functions
Check if Bluetooth files are present in the ios/ directory.
Verify the current iOS Bluetooth/WiFi setup without making changes.
Find the Xcode project or workspace in the given directory.
Print setup instructions without running the script.
Run the iOS Bluetooth/WiFi setup.
Check if an Xcode project exists in the given directory.
Types
Functions
Check if Bluetooth files are present in the ios/ directory.
Verify the current iOS Bluetooth/WiFi setup without making changes.
Returns {:ok, message} if all checks pass, {:error, reason} otherwise.
Find the Xcode project or workspace in the given directory.
@spec print_instructions() :: :ok
Print setup instructions without running the script.
Run the iOS Bluetooth/WiFi setup.
Returns {:ok, message} on success, {:error, reason} on failure.
Check if an Xcode project exists in the given directory.