Static Library shell scripts
#!/bin/bash# to build target name target_name= "Htkit" #编译模式 Release, debugbuild_model=release# gets the current path of the project project_path=$ ( PWD) #编译文件路径buildPath =${project_path}/build# Export the SDK address exportsdkpath=~/desktop/${target_name}-sdk/${build_model}if [ ! -D $exportSdkPath]; Thenmkdir-p $exportSdkPath; fi# real-Machine SDK path iphoneos_path=${buildpath}/${build_model}-iphoneos/lib${target_name}.a# Emulator SDK path simulator_path=${buildpath}/${build_model}-iphonesimulator/lib${target_name}.a# Merge SDK path merge_path=${ Exportsdkpath}/lib${target_name}.a#build before clean xcodebuild-target ${target_name} clean# simulator Buildxcodebuild- Target ${target_name}-configuration ${build_model}-sdk iphonesimulator# real machine buildxcodebuild-target ${target_Name}- Configuration ${build_model}-sdk iphoneos# copy header file to destination folder Cp-r ${buildpath}/${build_model}-iphoneos/include/${target_ Name} ${exportsdkpath} #合并模拟器和真机. A package Lipo-create ${iphoneos_path} ${simulator_path}-output ${merge_path} #压缩合并后的文件 # Compressed file name package_date= ' Date ' +%y-%m-%d-day%x ' sdk_zip_name=lib${target_name}_${build_model}_${package_date}.zip# jump to the output path of the SDK CD ${exportsdkpath} #压缩sdk输出路径下的所有文件zip-R ~/desktop/${target_name}-sdk/${sdk_zip_ Name}./* #打开合并后的sdk所在路径open ${exportsdkpath} #删除build文件if [-D ${buildpath}]; THENRM-RF ${buildpath}fi
iOS Development Series-shell script compilation SDK