yonaskolb / yonaskolb/XcodeGen

How can I set Host Application to main app target on test target for framework?

Open
#1,302 4 comments 1 reaction 0 assignees View on GitHub

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.

image

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.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.