iOS開發系列-Shell指令碼編譯SDK

來源:互聯網
上載者:User

標籤:clu   開發   刪除   路徑   模擬器   code   sdk   shell   merge   

靜態庫Shell指令碼
#!/bin/bash#要build的target名target_Name="HTKit"#編譯模式  Release、Debugbuild_model=Release#擷取工程當前所在路徑project_path=$(pwd)#編譯檔案路徑buildPath=${project_path}/build#匯出sdk地址exportSdkPath=~/Desktop/${target_Name}-SDK/${build_model}if [ ! -d $exportSdkPath ]; thenmkdir -p $exportSdkPath;fi#真機sdk路徑iphoneos_path=${buildPath}/${build_model}-iphoneos/lib${target_Name}.a#模擬器sdk路徑simulator_path=${buildPath}/${build_model}-iphonesimulator/lib${target_Name}.a#合并後sdk路徑merge_path=${exportSdkPath}/lib${target_Name}.a#build之前clean一下xcodebuild -target ${target_Name} clean#模擬器buildxcodebuild -target ${target_Name} -configuration ${build_model} -sdk iphonesimulator#真機buildxcodebuild -target ${target_Name} -configuration ${build_model} -sdk iphoneos#複製標頭檔到目標檔案夾cp -R ${buildPath}/${build_model}-iphoneos/include/${target_Name} ${exportSdkPath}#合并模擬器和真機.a包lipo -create ${iphoneos_path} ${simulator_path} -output ${merge_path}#壓縮合并後的檔案#壓縮後的檔案名稱package_date=`date '+%Y-%m-%d日%X'`sdk_zip_name=lib${target_Name}_${build_model}_${package_date}.zip#跳轉到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開發系列-Shell指令碼編譯SDK

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.