Appearance
Installation
Setup Overview
You will need the following development software to get the demo app running from source. Any actions documented regarding macOS can be taken on a remote Mac as well.
It is strongly recommended to install all software in the given order so Visual Studio Code can find the required Frameworks and SDKs right away.
- Git
- .NET 8.0 SDK
- XCode
- Microsoft OpenJDK 17.0
- Android Studio
- Android 14.0 ("UpsideDownCake") API Level 34
- Android SDK Build-Tools 34
- Android SDK Command-line Tools (latest)
- Visual Studio Code
You might be successful with other IDEs like Rider, but Microsoft recommends Visual Studio Code for .NET MAUI development so this documentation will not consider any other IDEs.
See also: What happened to Visual Studio for Mac?
Don't forget to add your Apple Developer Account to XCode and to set up your Certificate and Profile (more detail below).
Visual Studio Code Setup
- Install the above mentioned extensions for Visual Studio Code
- Clone the emrtd-connector-sdk-maui
- Open the cloned folder in Visual Studio Code
- Ignore the NuGet error popping up for now, the NuGet will be built later on
- Confirm installation of the
.NET MAUI SDKif asked - Install missing components and SDKs (if there are any left at this point):sh
cd kinegram-emrtd-connector-maui dotnet workload restore - Again, in your terminal, trigger a build on the missing NuGet:sh
cd kinegram-emrtd-connector-maui-android dotnet build kinegram-emrtd-connector-maui-android.csproj
This will create the kinegram-emrtd-connector-maui-android.x.x.x.nupkg which is the Android eMRTD Connector SDK wrapped in a NuGet for use in .NET MAUI. You can find further information regarding the SDKs and the steps required to apply changes made by yourself in Customizing the Native SDKs.
Starting the Android app
- Open a code file in the editor, for example
Pages/MainPage.xaml.cs - Click the curly brackets in the Status Bar (bottom right), click
Debug Targetand pick your device from the list presented – if your device does not show up in the list start ADB in your terminal:adb start-server - If Visual Studio Code asks for an Android SDK location, pick the one suggested, this usually is
/Users/<username>/Library/Android/sdkon macOS and/Users/<username>/AppData/Local/Android/sdkon Windows - Run the app
- Click the
Run and Debugicon on the left and then theRun and Debugbutton - Or click the
Run project associated with this file(play icon) on the top right
- Click the
Starting the iOS app
- Open
kinegram-emrtd-connector-maui.csprojand adjust the values inCodesignKeyandCodesignProvisionfor Debug and/or Release to your own certificate and profile names - Open
Platforms/Info.plistand adjustCFBundleIdentifierto the bundle identifier you set in your Apple Developer Account for this app - Open a code file in the editor, for example
Pages/MainPage.xaml.cs - Run the app
- Click the
Run and Debugicon on the left and then theRun and Debugbutton - Or click the
Run project associated with this file(play icon) on the top right
- Click the