Jenkins iOS ipa build and publish to Pgyer

 

1. Login to the https://developer.apple.com with apple developer accout and Generate a distribution profile

   Select provision profile type 'Distribution' -> 'Ad Hoc', Select App ID, Select distribution certificate and devices wish to include in this provisioning profile.

 Download the distribution provision profile and double click to install it.

 Refer to http://www.jianshu.com/p/71acb31eadd2 for certification and provision file related tips.

 

2. Configure the 'Code Signing' and 'Provision Profile' for the project in XCode

  1) Choose 'iOS Distribution' for the Release Code Signing Identity

  2) Set the distribution provision file in the project 'Build Settings' -> 'Code Signing' -> 'Release'.

 

3. Build .app

xcodebuild -sdk iphoneos -workspace TargetApp.xcworkspace -scheme "TargetApp" -configuration Release -arch arm64 -arch armv7 CONFIGURATION_BUILD_DIR="${WORKSPACE}/nativeClients/iOS/build/" clean build

 

4. Build final .ipa from .app

xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/nativeClients/iOS/build/target.app" -o "${WORKSPACE}/nativeClients/iOS/build/target.ipa"

 

5. Publish the .ipa

curl -F "file=@./build/target.ipa" -F "uKey=xxxxxxxxxxx" -F "_api_key=yyyyyyyyyyyy" -F "publishRange=2" -F "updateDescription=Auto publish by Jenkins with Git Commit ID: ${GIT_COMMIT}" https://www.pgyer.com/apiv1/app/upload

 

posted @ 2017-03-29 16:17  Majesty  阅读(208)  评论(0编辑  收藏  举报