IT박스

Xcode 8 Beta-현재 Swift 구문으로 변환 실패 : 테스트 호스트를 찾을 수 없습니다

itboxs 2020. 7. 22. 08:21
반응형

Xcode 8 Beta-현재 Swift 구문으로 변환 실패 : 테스트 호스트를 찾을 수 없습니다


Xcode 8의 변환 마법사를 사용하려고 할 때 오류 메시지가 나타납니다. 재부팅, 새로운 코드 다운로드 및 DerivedData 파일 삭제 후이 오류를 피할 수 없습니다.

현재 스위프트 구문으로 변환 실패 : 테스트 호스트를 찾을 수 없습니다

Swift 2.3과 Swift 3의 두 가지 옵션을 모두 시도했습니다. 버전을 선택한 후 즉시 해당 오류가 발생합니다.

다음은 오류의 스크린 샷입니다.

Xcode 8 변환 오류 메시지


이것은 나를 위해 일했다 :

  1. 왼쪽 브라우저에서 Xcode 프로젝트를 선택하십시오.
  2. 프로젝트 General에서 테스트 대상을 클릭 하십시오.
  3. "테스트"를 공개하십시오. 내 프로젝트에서 "호스트 애플리케이션"풀다운 버튼이 비어있었습니다. 적절한 호스트 응용 프로그램을 선택하십시오.
  4. 지금 테스트 대상을 작성하십시오. 성공하면 구문도 변환해야합니다.

I had this problem after installing the Xcode 8 beta so I assume this is related.

Picture Credit to @karthikkck 여기에 이미지 설명을 입력하십시오


It cost me a bit of time to find the "Host Application" pulldown mentioned in the otherwise very helpful answer by iluvcapra.

So this is what he meant:

This is where you find the pulldown menu. Select your main target.

풀다운 메뉴가있는 곳입니다


I find easy fix for this, just edit your Scheme and disable tests.

여기에 이미지 설명을 입력하십시오

And run conversion again.


+1 iluvcapra

Alternatively, use text editor to remove the following two items from your MyAppSwift.xcodeproj/project.pbxproj file, search for TEST_HOST

Now, re-open your project and run the convert wizard again.

    4EFFFAE51B53D5D8003CD25A /* Debug */ = {
        isa = XCBuildConfiguration;
        buildSettings = {
            BUNDLE_LOADER = "$(TEST_HOST)";
            FRAMEWORK_SEARCH_PATHS = (
                "$(SDKROOT)/Developer/Library/Frameworks",
                "$(inherited)",
            );
            GCC_PREPROCESSOR_DEFINITIONS = (
                "DEBUG=1",
                "$(inherited)",
            );
            INFOPLIST_FILE = "AF SwiftTests/Info.plist";
            LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
            PRODUCT_NAME = "FA SwiftTests";
            TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AF Swift.app/AF Swift";
        };
        name = Debug;
    };
    4EFFFAE61B53D5D8003CD25A /* Release */ = {
        isa = XCBuildConfiguration;
        buildSettings = {
            BUNDLE_LOADER = "$(TEST_HOST)";
            FRAMEWORK_SEARCH_PATHS = (
                "$(SDKROOT)/Developer/Library/Frameworks",
                "$(inherited)",
            );
            INFOPLIST_FILE = "AF SwiftTests/Info.plist";
            LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
            PRODUCT_NAME = "FA SwiftTests";
            TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AF Swift.app/AF Swift";
        };
        name = Release;
    };

여기에 이미지 설명을 입력하십시오

Please try these Steps:

  1. Select your project on the left side of Xcode.
  2. Go to Targets and select your Project Tests.
  3. Select the General Tab and select Host Application drop down and choose your Host Application.
  4. Convert or Run your project.

Trying these steps worked for me.


In my case I deleted my tests target, then re-added it using the + below targets and selecting "iOs Unit Testing Bundle"

For some reason this got a compile error, so I changed the "Per-configuration Intermediate Build Files Path: for my test target to $(PROJECT_TEMP_DIR)/$(CONFIGURATION) for both debug and release. This allowed the compile to work.


Fix this in 3 steps:

  1. First delete your test target
  2. The select Edit -> Convert -> To current Swift syntax... and perform the conversion
  3. Then add a new test target

참고URL : https://stackoverflow.com/questions/37847807/xcode-8-beta-convert-to-current-swift-syntax-failed-could-not-find-test-host

반응형