Skip to content

Laerdal/Laerdal.Dfu.Bindings.iOS

Repository files navigation

🏠 Laerdal.Dfu.Bindings.iOS

This is an MAUI binding library for iOS/MacCatalyst fueled by Nordic's native iOS-DFU library for updating the firmware of their devices over the air via BLE.

The native iOS Pod library is located here: https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library

🚀 Getting Started

You'll need :

  • MacOS
    • with XCode 16.1+
    • with .NET8-ios
    • with Carthage
    • [with ObjectiveSharpie] (optional)

🛠️ Build

brew cask install objectivesharpie

More about Objective Sharpie

Steps to build on Local-Dev

1) Checkout

git clone https://github.com/Laerdal/Laerdal.Dfu.Bindings.iOS.git

2) Build

# Note    If carthage fails in macos try cleaning up your carthage cache like so and then try again
# Note
# Note                       rm -rf ~/Library/Caches/org.carthage.CarthageKit
# Note
# 
# on macos
dotnet    msbuild                                    \
    Laerdal.Scripts/Laerdal.Builder.targets          \
    '"/m:1"'                                         \
    '"/p:Laerdal_Version_Full=1.0.x.0"'              \
    '"/p:Laerdal_Github_Access_Token=<place your github access token here - its needed by carthage>"'  

# on windows powershell
dotnet   msbuild                                     ^
    Laerdal.Scripts\Laerdal.Builder.targets          ^
    /m:1                                             ^
    /p:Laerdal_Version_Full=1.0.x.0                  ^
    /p:Laerdal_Github_Access_Token="<place your github access token here - its needed by carthage>"

You'll find the nuget in Output/

❗ Known issues

Fix : Laerdal/Laerdal.Dfu.iOS#3 (comment) |

#!/usr/bin/env sh

xcode_lib_path="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos"
app_path=$1
app_name=<insert app name>
libs=("$app_path/Products/Applications/$app_name/Frameworks/"*.dylib)

for i in "${libs[@]}"
do
  cp "$xcode_lib_path/$(basename "$i")" "$app_path/SwiftSupport/iphoneos/"
  cp "$xcode_lib_path/$(basename "$i")" "$app_path/Products/Applications/$app_name/Frameworks/"
done

-- Thanks @OliverFlecke

Fix : You might need to add "--optimize=-remove-dynamic-registrar" to your apps mtouch args.