Understand Fission’s generated iOS host

Follow shared Rust code through Fission's generated simulator scripts, Swift package inputs and final app bundle.
iOS

What you will build

Identify which files are app inputs, generated host inputs and packaged artifacts before diagnosing an iOS launch.
Trace the generated packaging script to the actual Cargo output
Distinguish the generated Swift package from an assumed Xcode project
Verify bundle contents and launch separately from source configuration
"The host" can mean several different things. Here it means the generated iOS packaging and launch scaffold around the shared Rust app. It is not another place to implement the journey planner's state or a promise that every platform capability has a Swift implementation.
We will trace a working Compose app from its entrypoint to a simulator bundle. This is more useful than an architecture card which changes its caption: we can identify which code supplies an interaction and which generated file makes that code launch on iOS.

Create a project to inspect

Complete iOS setup first.
cargo install cargo-fission
fission init ios-understand-fissions-generated-ios-host
cd ios-understand-fissions-generated-ios-host
fission add-target ios --project-dir .
cargo add serde_yaml
The generated directory includes these responsibilities:
fission.toml                       target, capability and package inputs
src/main.rs                        target-aware Rust entrypoint
src/lib.rs                         shell setup and shared app modules
platforms/ios/README.md             instructions for this generated host
platforms/ios/Info.plist            native bundle metadata
platforms/ios/Package.swift         generated Swift host package
platforms/ios/NativeModules/        configured native-module staging
platforms/ios/LaunchScreen.storyboard
platforms/ios/package-sim.sh        Rust build and simulator .app assembly
platforms/ios/run-sim.sh            simulator install and launch
platforms/ios/test-sim.sh           launch/control-endpoint smoke test
platforms/ios/package-ipa.sh         device IPA packaging and signing path
Read the generated README rather than assuming the host is an Xcode project with a conventional app target. The current scaffold is a simulator-bundle template and scripts, with generated Swift packages for native integration. The existence of Package.swift alone does not prove that a particular native module is linked and callable from Rust.

Run the finished example

fission run --target ios --project-dir .

1. Follow an actual shared component

Use the journey editor from the component tutorial as the app under inspection. It accepts real input and prepares a snapshot, so we can distinguish shared interaction behavior from native launch machinery.
Keep the generated src/main.rs. On iOS it calls run_mobile in the shared library. That function constructs MobileApp<JourneyState, _> with the same JourneyScreen and translation setup used by Web and desktop.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/app/state.rs","value":"src-app-state-rs"},{"index":2,"label":"src/app/fact.rs","value":"src-app-fact-rs"},{"index":3,"label":"src/app/summary.rs","value":"src-app-summary-rs"},{"index":4,"label":"src/app/screen.rs","value":"src-app-screen-rs"},{"index":5,"label":"src/i18n.rs","value":"src-i18n-rs"},{"index":6,"label":"src/lib.rs","value":"src-lib-rs"},{"index":7,"label":"preview/lib.rs","value":"preview-lib-rs"},{"index":8,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":9,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
mod fact;
mod screen;
pub mod state;
mod summary;
pub use screen::JourneyScreen;
pub use state::JourneyState;
{"id":"fission-tabs-1","index":1,"label":"src/app/state.rs","value":"src-app-state-rs"}
use fission::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Journey {
    pub origin: String,
    pub destination: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct JourneyState {
    pub prepared: Option<Journey>,
    pub locale: Locale,
}

impl Default for JourneyState {
    fn default() -> Self {
        Self {
            prepared: None,
            locale: Locale::from("en-US"),
        }
    }
}

impl GlobalState for JourneyState {}
{"id":"fission-tabs-1","index":2,"label":"src/app/fact.rs","value":"src-app-fact-rs"}
use super::state::JourneyState;
use fission::prelude::*;

fission_component! {
    pub JourneyFact<JourneyState> {
        props {
            label: TextContent,
            value: String,
        }
    }
    view(fact, _state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } => Column(gap: tokens.spacing.xs, children: [
        Text(fact.label.clone()).color(tokens.colors.text_secondary),
        Text(fact.value.clone()).weight(tokens.typography.font_weight_semibold),
    ])
}
{"id":"fission-tabs-1","index":3,"label":"src/app/summary.rs","value":"src-app-summary-rs"}
use super::{
    fact::JourneyFact,
    state::{Journey, JourneyState},
};
use fission::prelude::*;

fission_component! {
    pub JourneySummary<JourneyState> {
        props { journey: Journey }
        state { show_details: bool = false }
    }
    view(summary, _state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } => Container(
        Column(gap: tokens.spacing.m, children: [
            JourneyFact(
                TextContent::Key("journey.origin".into()),
                summary.journey.origin.clone(),
                key: "origin",
            ),
            JourneyFact(
                TextContent::Key("journey.destination".into()),
                summary.journey.destination.clone(),
                key: "destination",
            ),
            Button(
                child: Text(if summary.show_details { cx.tr("journey.hide") } else { cx.tr("journey.details") }),
                key: "toggle-details",
                on_press: reduce { summary.show_details = !summary.show_details; },
            ),
            if summary.show_details { Text(cx.tr("journey.scope")) },
        ]),
    )
    .padding_all(tokens.spacing.m)
    .border(tokens.colors.border, 1.0)
    .border_radius(tokens.radii.medium)
}
{"id":"fission-tabs-1","index":4,"label":"src/app/screen.rs","value":"src-app-screen-rs"}
use super::{
    state::{Journey, JourneyState},
    summary::JourneySummary,
};
use fission::prelude::*;

fission_component! {
    pub JourneyScreen<JourneyState> {
        state {
            origin: String = String::new(),
            destination: String = String::new(),
        }
    }
    view(screen, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } => SafeArea(
        child: Scroll(
            child: Container(Column(gap: tokens.spacing.m, children: [
                Text(cx.tr("journey.heading")).size(tokens.typography.heading2_size),
                Text(cx.tr("journey.explanation")),
                Row(gap: tokens.spacing.s, children: [
                    Button(
                        child: Text(cx.tr("language.english")), key: "english",
                        on_press: reduce { state.locale = Locale::from("en-US"); },
                    ),
                    Button(
                        child: Text(cx.tr("language.spanish")), key: "spanish",
                        on_press: reduce { state.locale = Locale::from("es-ES"); },
                    ),
                ]),
                FormControl(
                    label: Some(cx.tr("journey.origin")),
                    required: true,
                    child: TextInput(
                        value: screen.origin.clone(),
                        bind(on_input): to(screen.origin),
                    ),
                ),
                FormControl(
                    label: Some(cx.tr("journey.destination")),
                    required: true,
                    child: TextInput(
                        value: screen.destination.clone(),
                        bind(on_input): to(screen.destination),
                    ),
                ),
                if !screen.origin.trim().is_empty() && !screen.destination.trim().is_empty() {
                    Column(gap: tokens.spacing.s, children: [
                        Text(cx.tr("journey.draft")),
                        JourneySummary(
                            Journey {
                                origin: screen.origin.trim().to_owned(),
                                destination: screen.destination.trim().to_owned(),
                            },
                            key: "draft-summary",
                        ),
                    ])
                },
                Button(
                    child: Text(cx.tr("journey.prepare")), key: "prepare-journey",
                    disabled: screen.origin.trim().is_empty() || screen.destination.trim().is_empty(),
                    on_press: reduce {
                        state.prepared = Some(Journey {
                            origin: screen.origin.trim().to_owned(),
                            destination: screen.destination.trim().to_owned(),
                        });
                    },
                ),
                if let Some(journey) = &state.prepared {
                    Column(gap: tokens.spacing.s, children: [
                        Text(cx.tr("journey.prepared")),
                        JourneySummary(journey.clone(), key: "prepared-summary"),
                    ])
                },
            ]))
            .padding_all(tokens.spacing.l),
        ),
    )
}
{"id":"fission-tabs-1","index":5,"label":"src/i18n.rs","value":"src-i18n-rs"}
use fission::i18n::{Locale, TranslationBundle};
use fission::prelude::*;
use std::collections::HashMap;

pub fn create_env() -> Env {
    let mut env = Env::default();
    env.locale = Locale::from("en-US");
    for (locale, source) in [
        ("en-US", include_str!("../i18n/en-US.yaml")),
        ("es-ES", include_str!("../i18n/es-ES.yaml")),
    ] {
        let messages: HashMap<String, String> =
            serde_yaml::from_str(source).expect("valid journey translations");
        env.i18n.add_bundle(TranslationBundle {
            locale: Locale::from(locale),
            messages,
        });
    }
    env
}

pub fn sync_env(state: &crate::app::JourneyState, env: &mut Env) {
    env.locale = state.locale.clone();
}
{"id":"fission-tabs-1","index":6,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod i18n;

use app::{JourneyScreen, JourneyState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<JourneyState, _>::new(JourneyScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> {
    MobileApp::<JourneyState, _>::new(JourneyScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
    let _ = MobileApp::<JourneyState, _>::new(JourneyScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run_with_android_app(app_handle);
}

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<JourneyState, _>::new(JourneyScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
        .map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":7,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod i18n;

use fission::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<app::JourneyState, _>::new(app::JourneyScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .mount("#fission-web-mount")
        .run()
        .map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":8,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
journey.heading: "Prepare a journey plan"
journey.explanation: "Enter the places you want to travel between. Review the draft, then keep a prepared copy for this session."
journey.origin: "From"
journey.destination: "To"
journey.draft: "Current draft"
journey.prepare: "Prepare journey"
journey.prepared: "Prepared journey"
journey.details: "Show plan details"
journey.hide: "Hide plan details"
journey.scope: "These are the places you entered, not a calculated route or a reservation. Nothing has been sent or saved to disk."
language.english: "English"
language.spanish: "Español"
{"id":"fission-tabs-1","index":9,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
journey.heading: "Preparar un plan de viaje"
journey.explanation: "Introduce los lugares entre los que quieres viajar. Revisa el borrador y conserva una copia preparada para esta sesión."
journey.origin: "Desde"
journey.destination: "Hasta"
journey.draft: "Borrador actual"
journey.prepare: "Preparar viaje"
journey.prepared: "Viaje preparado"
journey.details: "Mostrar detalles del plan"
journey.hide: "Ocultar detalles del plan"
journey.scope: "Son los lugares que has introducido, no una ruta calculada ni una reserva. No se ha enviado ni guardado nada en disco."
language.english: "Inglés"
language.spanish: "Español"
{"id":"fission-tabs-1"}
Prepare a journey and change the draft. Locate the reducer block which copies the prepared snapshot. No Swift file owns that transition; the browser and iOS app use the same Rust implementation.
Show the app preview
Hide the app preview

2. Trace the output rather than inferring it from names

The simulator packaging script runs Cargo for the configured iOS simulator target, obtains Cargo's actual target directory through metadata and copies the resulting executable into a .app bundle. It then installs the bundle metadata and image resources and compiles the launch storyboard with ibtool. The simulator run script installs and launches that bundle with simctl.
Run the generated entrypoint on your Mac:
fission doctor ios --project-dir .
./platforms/ios/package-sim.sh
The script prints the resulting bundle path. Inspect that bundle's executable, Info.plist, icon and compiled storyboard. Looking only at platforms/ios/Info.plist checks an input; it does not establish that the packaged metadata contains the same intended values after the packaging substitutions.
Keep configuration in fission.toml where the CLI exposes the setting. For example, capability commands synchronize privacy metadata and the documented splash/icon tables supply generated assets. Editing a copied resource in the output bundle changes one artifact, not the project's authority, and can disappear on the next build.
Native-module source is a separate integration boundary. Read its generated README before adding code, and prove the generated package is built, linked and invoked. Do not move ordinary state transitions there just because a NativeModules folder exists.
Identify the generated files which supply bundle identity and launch artwork, then find the same values in the built artifact. Record the artifact path separately from the source path. The Web preview cannot inspect either on your computer.
Show the app preview
Hide the app preview

3. Separate launch, interaction and device distribution

fission devices --project-dir .
fission run --target ios --project-dir .
fission test --target ios --project-dir .
Follow the simulator guide for target selection. After launch, repeat the journey task and language switch. A healthy control endpoint proves the host reached its event loop; it does not prove a button updates the correct record or the keyboard leaves it reachable.
A physical iPhone uses the device target and signing path, not the simulator binary with another filename. Follow the installation guide and the TestFlight guide rather than treating simulator packaging as release qualification.
When a failure occurs, keep its boundary clear. A Cargo compile error belongs before bundle assembly; a missing storyboard resource belongs to packaging; an installation/signature rejection occurs later; an incorrect prepared journey is shared app behavior. Starting from the real failing step avoids changing an unrelated layer merely because it contains an iOS-looking filename.