2012-06-07 2 views

답변

11

iPhone 시뮬레이터 또는 장치에서 실행 중인지 확인하기위한 컴파일러 지시문 (조건부 컴파일 기호)이 없습니다. 당신이, 당신이 컴파일러 옵션에서 자신의 컴파일 시간 기호를 추가 할 수 있습니다해야하는 경우 http://docs.xamarin.com/ios/recipes/General/Projects/Environment_Checks

+2

:

using ObjCRuntime; static bool InSimulator() { return Runtime.Arch == Arch.SIMULATOR; } 

이 여기에서있다 :

당신은 그러나이 코드를 사용하여 런타임에 그것을 확인할 수 있습니다 각 프로젝트 설정 – Stuart

+0

이 Xamarin.iOS에 지금'정적 부울 InSimulator() \t \t { \t \t \t 반환 ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.SIMULATOR; \t \t} https://developer.xamarin.com/api/type/ObjCRuntime.Arch/ –

+0

@BenButzer : 감사합니다. 답변도 업데이트했습니다. –

관련 문제