Skip to content

#194: Add instructions to run examples on iOS Simulator using mint and swift-bundler #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2025

Conversation

Vitorsilveira31
Copy link
Contributor

This PR adds a new section to the README with step-by-step instructions on how to run the Swift package examples on the iOS Simulator. Since the examples are distributed as Swift packages, they can’t be run directly on iOS without additional setup.

Using tools like mint and swift-bundler simplifies running these examples without needing to create an Xcode project manually. The instructions include installation steps and a sample command to run the CounterExample on the iPhone simulator.

This addition should help new users get started quickly and improve overall developer experience.

@stackotter
Copy link
Owner

Thanks for pointing out this gap in the readme. I reckon it might even make sense to just replace the existing swift run CounterExample instructions and recommend Swift Bundler for all platforms.

It's probably worth linking to Swift Bundler's official installation instructions as well.

We could maybe move the existing SwiftPM-based instructions to a small sentence along the lines of "These examples may be run on your host machine without Swift Bundler by running swift run TargetName, but resources may not end up where the examples expect them to be so do not expect everything to work."


Here's what I reckon it could look like

Clone the SwiftCrossUI repository to test out this example, and many more. Running the examples requires a Swift Bundler installation. You may be able to run the examples directly with SwiftPM, but your mileage may vary depending on whether the example contains resources or requires features such as deep linking. You also won't be able to run them on iOS/tvOS devices.

git clone https://github.com/stackotter/swift-cross-ui
cd swift-cross-ui/Examples
# Run on host machine
swift-bundler run CounterExample
# Run on iOS (or tvOS) device containing 'iPhone' in its name (macOS-only)
swift-bundler run CounterExample --device iPhone
# Run on iOS (or tvOS) simulator containing 'iPhone 16' in its name (macOS-only)
swift-bundler run CounterExample --simulator "iPhone 16"

@Vitorsilveira31
Copy link
Contributor Author

@stackotter hey, I've updated it. Do you think it works?

@stackotter stackotter changed the base branch from main to readme_sbun June 25, 2025 01:14
Copy link
Owner

@stackotter stackotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this 🙏 There are just a few changes I want to make but I'll merge into my own branch and then do them there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants