Deploying to Device#
Once you've defined a procedure in Python, you need to serialize it and import it to the iOS app.
Serialization#
Convert your procedure to JSON:
import capturegraph.procedures as cgp
# Your procedure definition
procedure = my_procedure()
# Serialize to JSON string
json_string = cgp.procedure_to_json(procedure)
# Write to file
with open("MyProcedure.json", "w") as f:
f.write(json_string)
Tip: Give your procedure a unique, descriptive name so it's easy to identify in the app.
Importing to iOS#
Transfer the JSON file to the CaptureGraph iOS app:
Option 1: Files App#
- Connect your device to your Mac
- Open Finder and select your device
- Navigate to Files → CaptureGraph
- Drag your
.jsonfile into the folder
Option 2: CaptureGraph Server#
For team deployments, upload procedures to the server:
- Upload your procedure JSON to the server
- Team members sync via the app
- Everyone gets the same procedure automatically
Verifying Import#
After importing:
- Open the CaptureGraph app
- Your procedure should appear in the procedure list
- Tap it to create a new Capture Target
- Run through the procedure to test
Next Steps#
- Types and Nodes — Understand the type system
- Fluent API — Master method chaining