2011-11-05 2 views
3

iOS 시뮬레이터에서 응용 프로그램 테스트를 실행할 수있는 Xcode4의 기능에 대해 혼란 스럽습니다.Xcode 4 : iOS 시뮬레이터의 응용 프로그램 테스트

한편 Apple의 설명서에 따르면 시뮬레이터에서 응용 프로그램 테스트를 실행할 수 있다고합니다. 다른 한편으로는 여기서 포럼을 읽었으며 응용 프로그램 테스트는 장치에서만 실행할 수 있다는 것이 대부분의 사람들이 발견 한 것처럼 보입니다.

후자가 사실이라면이를 기록하는 링크를 포함하십시오. 나는 아무것도 찾을 수 없었다. 어쨌든

, iOS App Development Workflow Guide:Unit Testing Applications에서 :

Listing 6-2 Transcript of an iOS Simulator-based application unit-test run

또한

Note: Although Xcode can run logic and application unit tests in simulators, Xcode cannot run logic unit tests on devices. Therefore, if you include and have active both types of unit tests in a scheme, you will not be able to use that scheme to run unit tests on devices.

문제는 시뮬레이터가하는 것입니다 UIApplicationDelegate에 대한 액세스를 제공하지 않습니다. 다음은 샘플 테스트가 증명하는 것입니다

- (void) testAppDelegate { id yourApplicationDelegate = [[UIApplication sharedApplication] delegate]; STAssertNotNil(yourApplicationDelegate, @"UIApplication failed to find the AppDelegate"); }

이 테스트는 내 프로젝트에 실패합니다. BTW 내 논리 테스트가 잘 실행됩니다.

답변

3

나쁘다. 나는 너무 빨리 말했다. 난 this solution 시도하고 작동합니다. 즉, 이제 iOS Simulator에서 논리 테스트와 응용 프로그램 테스트를 모두 실행할 수 있습니다.

테스트 대상의 빌드 설정에 bundle loadertest host 매개 변수를 모두 설정해야합니다.