Skip to content

Commit

Permalink
fix:m1 chip device running simulator error & xcode15 running error wh…
Browse files Browse the repository at this point in the history
…en pod version < 1.13
  • Loading branch information
tamworth committed May 8, 2024
1 parent b7ac81b commit cef00e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions iOS/APIExample/APIExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/APIExample",
Expand Down Expand Up @@ -2534,6 +2535,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/APIExample",
Expand Down Expand Up @@ -2693,6 +2695,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/APIExample",
Expand Down Expand Up @@ -2767,6 +2770,7 @@
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/APIExample",
Expand Down Expand Up @@ -2842,6 +2846,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = SimpleFilter/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand Down Expand Up @@ -2879,6 +2884,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = SimpleFilter/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand Down
13 changes: 13 additions & 0 deletions iOS/APIExample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,16 @@ end
pre_install do |installer|
# system("sh .download_script.sh 4.3.1 true")
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
# fix Xcode version > 15.0 & cocoapods version < 1.13.0
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end
end

0 comments on commit cef00e0

Please sign in to comment.