From c15605afd39acacbcd620c197ce3c96a3bc5b03e Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Wed, 23 Feb 2022 09:07:15 -0800 Subject: [PATCH] Fixes for Mac Catalyst Summary: When building for Mac Catalyst, it mostly appears as if it's targeting iOS (`TARGET_OS_OSX` is `0`) and the behavior should be aligned with iOS Simulator builds. Reviewed By: lblasa Differential Revision: D34413681 fbshipit-source-id: 1e56bbb3f16f8cd78e77771ff641c5cfcbc49955 --- iOS/FlipperKit/FlipperClient.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iOS/FlipperKit/FlipperClient.mm b/iOS/FlipperKit/FlipperClient.mm index 948a90902..ce211e488 100644 --- a/iOS/FlipperKit/FlipperClient.mm +++ b/iOS/FlipperKit/FlipperClient.mm @@ -23,7 +23,7 @@ #if !TARGET_OS_OSX #import -#if !TARGET_OS_SIMULATOR +#if !TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST #import #endif #endif @@ -35,7 +35,7 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; folly::ScopedEventBaseThread sonarThread; folly::ScopedEventBaseThread connectionThread; id _certProvider; -#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR +#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST FKPortForwardingServer* _secureServer; FKPortForwardingServer* _insecureServer; #endif @@ -74,7 +74,11 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; NSString* deviceOS; NSString* deviceName; #if !TARGET_OS_OSX +#if !TARGET_OS_MACCATALYST deviceOS = @"iOS"; +#else + deviceOS = @"MacOS"; +#endif deviceName = [[UIDevice currentDevice] name]; #if TARGET_OS_SIMULATOR deviceName = [NSString stringWithFormat:@"%@ %@", @@ -152,7 +156,7 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; } - (void)start { -#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR +#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST _secureServer = [FKPortForwardingServer new]; [_secureServer forwardConnectionsFromPort:9088]; [_secureServer listenForMultiplexingChannelOnPort:9078]; @@ -165,7 +169,7 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; - (void)stop { _cppClient->stop(); -#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR +#if !TARGET_OS_OSX && !TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST [_secureServer close]; _secureServer = nil; [_insecureServer close];