yonaskolb / yonaskolb/XcodeGen
How can I set Host Application to main app target on test target for framework?
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
I have the following targets:
- MyApp
- MyAppTests
- APIClient (embeded framework)
- APIClientTests
I want to run APIClientTests on device not on Simulator.
APIClientTests target setting is like following:
targets:
APIClientTests:
dependencies:
- target: APIClient
codeSign: false
platform: iOS
type: bundle.unit-test
Using this setting, Host Application will be None.

How can I set Host Application to MyApp?
I tried setting TEST_HOST to $(BUILT_PRODUCTS_DIR)/MyApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/MyApp but it didn't work.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the APIClientTests target configuration and the generated Xcode target settings, focusing on how a bundle.unit-test target's host application is selected. Verify the generated project on an iOS device; done when APIClientTests uses MyApp as its host instead of None and the target can run on device.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift, yaml
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100