@@ -617,7 +617,28 @@ static bool FBSAddEventDataToOptions(NSMutableDictionary *options,
617617 info.major_version = vers_cmd.version >> 16 ;
618618 info.minor_version = (vers_cmd.version >> 8 ) & 0xffu ;
619619 info.patch_version = vers_cmd.version & 0xffu ;
620- info.maybe_simulator = true ;
620+
621+ // Disambiguate legacy simulator platforms.
622+ #if (defined(__x86_64__) || defined(__i386__))
623+ // If we are running on Intel macOS, it is safe to assume this is
624+ // really a back-deploying simulator binary.
625+ switch (info.platform ) {
626+ case PLATFORM_IOS:
627+ info.platform = PLATFORM_IOSSIMULATOR;
628+ break ;
629+ case PLATFORM_TVOS:
630+ info.platform = PLATFORM_TVOSSIMULATOR;
631+ break ;
632+ case PLATFORM_WATCHOS:
633+ info.platform = PLATFORM_WATCHOSSIMULATOR;
634+ break ;
635+ }
636+ #else
637+ // On an Apple Silicon macOS host, there is no ambiguity. The only
638+ // binaries that use legacy load commands are back-deploying
639+ // native iOS binaries. All simulator binaries use the newer,
640+ // unambiguous LC_BUILD_VERSION load commands.
641+ #endif
621642 };
622643 switch (cmd) {
623644 case LC_VERSION_MIN_IPHONEOS:
@@ -778,34 +799,6 @@ static bool FBSAddEventDataToOptions(NSMutableDictionary *options,
778799 uuid_copy (inf.uuid , uuidcmd.uuid );
779800 }
780801 if (DeploymentInfo deployment_info = GetDeploymentInfo (lc, load_cmds_p)) {
781- // Simulator support. If the platform is ambiguous, use the dyld info.
782- if (deployment_info.maybe_simulator ) {
783- if (deployment_info.maybe_simulator ) {
784- #if (defined(__x86_64__) || defined(__i386__))
785- // If dyld doesn't return a platform, use a heuristic.
786- // If we are running on Intel macOS, it is safe to assume
787- // this is really a back-deploying simulator binary.
788- switch (deployment_info.platform ) {
789- case PLATFORM_IOS:
790- deployment_info.platform = PLATFORM_IOSSIMULATOR;
791- break ;
792- case PLATFORM_TVOS:
793- deployment_info.platform = PLATFORM_TVOSSIMULATOR;
794- break ;
795- case PLATFORM_WATCHOS:
796- deployment_info.platform = PLATFORM_WATCHOSSIMULATOR;
797- break ;
798- }
799- #else
800- // On an Apple Silicon macOS host, there is no
801- // ambiguity. The only binaries that use legacy load
802- // commands are back-deploying native iOS binaries. All
803- // simulator binaries use the newer, unambiguous
804- // LC_BUILD_VERSION load commands.
805- deployment_info.maybe_simulator = false ;
806- #endif
807- }
808- }
809802 const char *lc_platform = GetPlatformString (deployment_info.platform );
810803 // macCatalyst support.
811804 //
0 commit comments