# {{PROJECT_NAME_PASCAL}} iOS Benchmark App

This is an auto-generated iOS app for running Rust benchmarks and local native profiling captures.

## Building

```bash
# Generate Xcode project (if using xcodegen)
xcodegen generate

# Build for simulator
xcodebuild -scheme BenchRunner -destination 'platform=iOS Simulator,name=iPhone 15' build

# Build for device
xcodebuild -scheme BenchRunner -destination 'generic/platform=iOS' build
```

## Benchmark execution

For BrowserStack benchmarking, you need both the app IPA and the XCUITest runner:

```bash
# Package the app as IPA
cargo mobench package-ipa --method adhoc

# Package the XCUITest runner
cargo mobench package-xcuitest

# Run on BrowserStack (use --release for smaller builds)
cargo mobench run --target ios --function my_benchmark \
  --devices "iPhone 14-16" --release
```

For local simulator execution:

```bash
cargo mobench run --target ios --function my_benchmark
```

## Local native profiling

```bash
cargo mobench profile run \
  --target ios \
  --provider local \
  --backend ios-instruments \
  --function my_benchmark
```

## Running Benchmarks

The app reads benchmark configuration from:
1. Environment variables
2. Launch arguments
3. `bench_spec.json` in bundle
4. Default values in code

## Benchmark report capture

The app emits benchmark results for both local automation and BrowserStack:
- Displays results long enough for capture/inspection
- Outputs JSON with `BENCH_REPORT_JSON_START/END` markers
- XCUITest extracts results via accessibility identifiers
- Supports profiling launch options that can delay, warm, or repeat the benchmark to fill a local native capture window

## Generated by

[mobench](https://crates.io/crates/mobench) - Mobile benchmarking SDK for Rust
