You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/BuildBrainFlow.rst
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,14 +167,25 @@ Local build example:
167
167
168
168
The Swift package intentionally does not vendor BrainFlow native binaries. Like source builds for other bindings, it dynamically loads native libraries built from this repository. The loader searches :code:`BRAINFLOW_LIB_DIR`, system library paths, :code:`installed/lib`, and app bundle resource/framework directories for :code:`libBoardController`, :code:`libDataHandler`, and :code:`libMLModule`.
169
169
170
+
For production iOS and macOS applications, use Apple XCFramework artifacts and the generated Swift binary package. Regenerate Apple artifacts with:
The default generated artifact directory is :code:`build/apple_xcframeworks`. It contains :code:`XCFrameworks`, :code:`BrainFlowSwiftBinaryPackage`, :code:`BrainFlowAppleXCFrameworks.zip`, and checksum files. These generated headers and binaries are release/CI artifacts, not source files committed to the repository.
178
+
179
+
The generated :code:`BrainFlowSwiftBinaryPackage` contains the Swift API and binary targets for :code:`BoardController.xcframework`, :code:`DataHandler.xcframework`, and :code:`MLModule.xcframework`. Add this package to an app through Xcode or Swift Package Manager so embedded frameworks are handled by standard Apple build, embed, and signing flows.
180
+
170
181
The macOS demo can be built with:
171
182
172
183
.. code-block:: bash
173
184
174
185
cd swift_package
175
186
BRAINFLOW_LIB_DIR=../installed/lib swift run BrainFlowMacDemo
176
187
177
-
iOS and Mac App Store sample source and release-preparation notes are available in :code:`swift_package/examples/apps`and :code:`swift_package/Docs/AppStoreReadiness.md`. iOS runtime support requires BrainFlow native libraries compiled for the target iOS architectures and embedded as signed app-bundle libraries or XCFrameworks.
188
+
iOS and Mac App Store sample source and release-preparation notes are available in :code:`swift_package/examples/apps`, :code:`swift_package/Docs/AppleBinaryDistribution.md`, and :code:`swift_package/Docs/AppStoreReadiness.md`. App runtime support requires matching BrainFlow native frameworks embedded and signed inside the app bundle; App Store builds should not depend on :code:`BRAINFLOW_LIB_DIR` or local development directories.
Copy file name to clipboardExpand all lines: swift_package/Docs/AppStoreReadiness.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,42 @@ This checklist is intentionally separate from the sample source because final Ap
8
8
- Replace placeholder bundle IDs.
9
9
- Add production app icons and screenshots.
10
10
- Keep the synthetic-board demo path available so App Review can exercise the app without external hardware.
11
-
- Embed BrainFlow native libraries or XCFrameworks in the app bundle and sign them with the app.
11
+
- Embed BrainFlow XCFramework products in the app bundle and sign them with the app.
12
+
- Use the generated `BrainFlowSwiftBinaryPackage` for production app integration. Do not rely on `BRAINFLOW_LIB_DIR`, local `installed/lib` folders, or loose development dylibs in App Store builds.
12
13
- Confirm final privacy answers reflect real-board connectivity, Bluetooth, networking, files, and any third-party native dependencies actually shipped.
13
14
- Run an archive build and install it on a physical device or clean Mac before upload.
15
+
- Verify the archive contains only device slices for iOS, with embedded framework install names in the form `@rpath/<Framework>.framework/<Framework>`.
14
16
15
17
## iOS
16
18
17
19
- Use `examples/apps/ios/BrainFlowiOSDemo` as the Xcode app project.
18
-
-Keep `swift_package` as the local package dependency.
19
-
- Provide iOS-compatible BrainFlow native binaries. The current high-level Swift package compiles for iOS, but the app can only run BrainFlow calls when matching native libraries are embedded.
20
+
-Use the generated Swift binary package or embed framework slices from `build/apple_xcframeworks/XCFrameworks`.
21
+
- Provide iOS-compatible BrainFlow native binaries through XCFrameworks. The high-level Swift package compiles for iOS, but BrainFlow calls can only run when matching native frameworks are embedded and signed.
20
22
- For Muse native BLE boards, build BrainFlow native libraries with BLE support enabled for the target platform and keep the Bluetooth privacy string in the app plist.
21
23
- Keep permissions minimal. The synthetic-board demo needs no network or file permissions.
22
24
- Test via TestFlight before App Store submission.
23
25
24
26
## macOS
25
27
26
-
- Use `swift_package` product `BrainFlowMacDemo` for local development, or create an Xcode app target for App Store archiving.
28
+
- Use `swift_package` product `BrainFlowMacDemo` for local development, or package it with `tools/apple/package_macos_demo_app.sh`for app-bundle smoke testing.
27
29
- Add the files from `examples/apps/macos/BrainFlowMacDemo`.
28
30
- Enable App Sandbox.
29
-
- Embed and sign BrainFlow dylibs/XCFrameworks.
30
-
- Verify dynamic loading works inside the archived app bundle, not only with `BRAINFLOW_LIB_DIR`.
31
+
- Embed and sign BrainFlow XCFramework products.
32
+
- Verify dynamic loading works inside the app bundle, not only with `BRAINFLOW_LIB_DIR`.
31
33
32
34
## Production Gate
33
35
34
36
- Swift package builds.
35
37
- Swift tests pass with native libraries present.
36
38
- CLI smoke test succeeds with the synthetic board.
37
-
- iOS and macOS app targets launch, handle missing native libraries gracefully, and run the synthetic-board workflow when libraries are embedded.
39
+
-`tools/apple/build_xcframeworks.sh` and `tools/apple/verify_xcframeworks.sh` pass.
40
+
-`tools/apple/regenerate_artifacts.sh` refreshes `build/apple_xcframeworks`, and `tools/apple/verify_xcframeworks.sh build/apple_xcframeworks` passes.
41
+
- The Apple release artifact set includes `BrainFlowAppleXCFrameworks.zip`,
42
+
`BrainFlowAppleXCFrameworks.zip.sha256`, `checksums.sha256`, and `manifest.json` from the same
43
+
build.
44
+
-`manifest.json` records the BrainFlow version, source revision, toolchain versions, deployment
45
+
targets, and optional native feature flags.
46
+
- A clean app consumes `BrainFlowSwiftBinaryPackage` without building native BrainFlow locally.
47
+
- iOS and macOS app targets launch, handle missing native frameworks gracefully, and run the synthetic-board workflow when frameworks are embedded.
38
48
- Accessibility labels and dynamic text behavior are reviewed in the sample apps.
39
49
- Crash logs are clean after repeated start, stop, read, and release cycles.
0 commit comments