- Notifications
You must be signed in to change notification settings - Fork 1
Home
#!/bin/bash
AppInfoPath="/Users/YangWD/Desktop/AppTest"
build_workspace="ZCFundManage.xcworkspace"
project_path=$(pwd) project_name=$(ls | grep xcodeproj | awk -F.xcodeproj '{print $1}')
app_infoplist_path=${project_path}/${project_name}/Info.plist
bundleShortVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "${app_infoplist_path}")
bundleVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" "${app_infoplist_path}")
build_scheme="ZCFundManage"
build_config="Release"
/usr/libexec/PlistBuddy -c "set :CFBundleIdentifier ${oldAppFile}" "$app_infoplist_path"
/usr/libexec/PlistBuddy -c "set :CFBundleName ${appFile}" "$app_infoplist_path" /usr/libexec/PlistBuddy -c "set :CFBundleDisplayName ${appFile}" "$app_infoplist_path"
provisioningProfile='"XC Ad Hoc: com.xxxxxx.yyyyyy"'
timeStamp="$(date +"%Y%m%d_%H%M%S")" echo "*****打包时间:$timeStamp" if [ ! -d "$project_path/$build_workspace" ]; then echo "Error!Current path is not a xcode workspace.Please check, or do not use -w option." exit 2 fi
clean_cmd='xcodebuild' clean_cmd=${clean_cmd}' clean -workspace '${build_workspace}' -scheme '${build_scheme}' -configuration '${build_config}
$clean_cmd > $build_path/clean_qa.log || exit
archive_name="ZCFundManage_${bundleShortVersion}_${timeStamp}.xcarchive" archive_path="$build_path/"$archive_name build_cmd='xcodebuild' build_cmd=${build_cmd}' -workspace '${build_workspace}' -scheme '${build_scheme}' -destination generic/platform=iOS archive -configuration '${build_config}' ONLY_ACTIVE_ARCH=NO -archivePath '${archive_path} echo "** Archiving ZF ** to the ${archive_path}"
$build_cmd >
ipa_name="ZCFundManage_${bundleShortVersion}_${timeStamp}.ipa" ipa_path="$build_path/"$ipa_name ipa_cmd='xcodebuild' ipa_cmd=${ipa_cmd}' -exportArchive -exportFormat ipa -archivePath '${archive_path}' -exportPath '${ipa_path}' -exportProvisioningProfile '${provisioningProfile}
echo "** Exporting ZF ** to the