TestoSim is a testosterone pharmacokinetics simulation app that helps visualize injection protocols and predict hormone levels.
- Removed TestosteroneEster Model: Simplified the codebase by removing the redundant TestosteroneEster model in favor of the more flexible Compound model
- Protocol Type Selection: Protocols now clearly identify as either compound-based or blend-based
- CloudKit Integration: Fixed container ID issues in CoreDataManager and improved iCloud sync stability
- UI Improvements: Updated protocol creation process with a streamlined interface for compound and blend selection
- Calibration View Fixes: Resolved compiler issues with CalibrationResultView and parameter naming conflicts
- Code Cleanup: Fixed various Swift compiler warnings and improved view composition to avoid "unable to type-check" errors
The app now provides a more consistent experience when creating and managing protocols, with proper support for different compound types and routes of administration.
To prevent issues with multiple simulator instances, use the following scripts:
./build-test.sh [clean]- Use this script to build the application without launching a simulator
- Add
cleanparameter to perform a clean build - After building, use SweetPad to run the app in a simulator
./close-simulators.sh- Shuts down all running simulator instances
- Use this if multiple simulators are running and causing issues
./launch-test.sh [device_name]- Builds, installs, and launches the app in a specified simulator
- Defaults to "iPhone 16" if no device is specified
- Example:
./launch-test.sh "iPhone 16 Pro" - Automatically closes other simulators before launching
For the best development experience:
-
Use VS Code with SweetPad extension:
- Run task "SweetPad: Build" from the command palette (Cmd+Shift+P) or context menu
- This builds and runs the app in a single simulator instance
-
For command-line builds:
- Use
./build-test.shto build without launching simulators - Use
./close-simulators.shif you have multiple simulators running
- Use
-
For testing specific issues:
- Use
./launch-test.shto launch in a specific simulator - This helps isolate issues by using a clean, single simulator instance
- Use
If the app crashes during launch:
- Close all simulators:
./close-simulators.sh - Clean build:
./build-test.sh clean - Launch with a specific device:
./launch-test.sh "iPhone 16"
If errors still occur, check the device logs:
xcrun simctl spawn booted log stream --predicate 'processImagePath contains "TestoSim"' --style compactTestoSim uses CloudKit for cloud data synchronization across devices. This allows users to access their protocols, compounds, and bloodwork results on all their iOS devices.
- User profiles, protocols, and bloodwork data synchronize across devices
- Automatic conflict resolution and merging
- Offline capability with sync when connectivity is restored
- The app uses
NSPersistentCloudKitContainerfor Core Data + CloudKit integration - CloudKit sync can be toggled on/off in the app settings
- Data is stored in the
iCloud.flight505.TestoSimprivate database
- User must be signed into iCloud on the device
- iCloud Drive must be enabled
- Proper entitlements are included in the app bundle
If data is not syncing properly:
- Verify the user is signed into iCloud: Settings > Apple ID > iCloud
- Check iCloud Drive is enabled
- In the app, toggle CloudKit sync off and back on
- Restart the app after changing sync settings for changes to take effect
TestoSim uses a comprehensive system for selecting compounds:
-
Compounds Library: A full database of compounds with accurate pharmacokinetic parameters:
- Testosterone esters (propionate, enanthate, cypionate, etc.)
- Other compounds (nandrolone, trenbolone, boldenone, etc.)
- Various administration routes (intramuscular, subcutaneous, oral, transdermal)
-
Vial Blends: Support for commercial multi-compound blends:
- Pre-defined blends like Sustanon 250/350
- Each component tracked individually with proper pharmacokinetics
- Compounds are modeled with class types, esters, half-lives, and route-specific parameters
- Complete absorption and bioavailability characteristics for each compound and route
- Accurate simulation of single compounds and complex blends
The TestoSim app uses OpenAI's API for generating insights about hormone protocols and cycles. The app includes a free test API key with a $20 spending limit for all users.
When cloning this repository for development:
-
The app uses configuration files to store API keys:
Config.xcconfig- For build-time configurationConfig.plist- For runtime configuration
-
Sample files with placeholders are included in the repository:
Config-Sample.xcconfigConfig-Sample.plist
-
On first build, the script
copy-config.shwill automatically copy the sample files to create the real config files if they don't exist. -
To set up your own API key:
- Open
TestoSim/Config.plist - Replace the placeholder value with your OpenAI API key
- Clean and rebuild the project
- Open
- Both
Config.xcconfigandConfig.plistare excluded from git in.gitignore - Users can toggle between using their own API key or the test API key in the AI settings
- The API key is never stored directly in the source code