紀錄 Xcode 15、Apple Silicon 遇到的問題-持續更新

Zhi-Hong Lin
Nov 15, 2023

--

  1. 在 Xcode 15 Cocoapods 會遇到以下 error:
Error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

怎麼解決?

在 Podfile 加上以下程式碼

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
xcconfig_path = config.base_configuration_reference.real_path
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
end
end
end

2. 在 Apple Silicon 的機器跑 fastlane unit test 記得多設定 run_rosetta_simulator: true參數,不然會 fail

run_tests(
clean: true,
run_rosetta_simulator: true,
scheme: ENV['SCHEME']
)

3. 在 Xcode 15 手動上傳 ipa 到 App Store Connect 步驟時:

Apple 帳號存取權限

  • Developer — 只能透過 Custom 上傳,否則會報錯
  • App Manager — 可透過任何方式上傳

4. 在 Xcode 15 使用 Swiftlint 在 Run script 時會遇到以下錯誤

error: Sandbox: swiftlint(19427) deny(1) file-read-data

如何解決?

原因是 Xcode 15 在 Build Setting 裡將 ENABLE_USER_SCRIPT_SANDBOXING 預設值改成設定為 YES,因此設定成 No 即可解決

持續更新

--

--

No responses yet