使用shell脚本自动打包
# https://www.jianshu.com/p/9ee046d931a7
xcworkspacePath="xxx/xxx.xcworkspace"
SCHEMECA="xxxx"
archivePath="xxx/xxx.xcarchive"
ipa_dir_path="xxx/xxx"
exportOptionsPlistPath="xx/xx.plist"
#### Clean ######
xcodebuild clean -workspace "$xcworkspacePath" \
-scheme "$SCHEMECA" \
-configuration "Release"
#### Archive ######
xcodebuild archive -workspace "$xcworkspacePath" \
-scheme "$SCHEMECA" \
-configuration "Release" \
-archivePath "$archivePath"
### Export #####
xcodebuild -exportArchive \
-archivePath "$archivePath" \
-exportPath "$ipa_dir_path" \
-exportOptionsPlist "$exportOptionsPlistPath"
M1芯片电脑不能运行模拟器
M1芯片的电脑Xcode模拟器运行不了处理
1、开启rosetta2
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
2、在Podfile文件的地步增加如下配置
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"
end
end
end
3、Xcode14.3 不能archive的问题处理
参考:Xcode 14.3 Archive 失败
Pods
->Targets Support Files
->Pods-xxxx-framworks.sh
,修改配置
# 找到
source="$(readlink "${source}")"
# 替换为
source="$(readlink -f "${source}")"
image.png
网友评论