• Jenkins 搭建U3D自动发布 IOS


    http://www.cnblogs.com/yinghuochong/archive/2013/09/01/3294940.html 

    1.安装包,工具略过。

    2.插件管理 

    This plugin adds the Subversion support (via SVNKit) to Jenkins.
    This plugin will upload .ipa or .apk file(s) to testflightapp.com for distribution.
    This plugin provides builders to build xcode projects, invoke agvtool and package .ipa files
    This plug-in adds reusable macro expansion capability for other plug-ins to use.
    This plugin provides a new enhanced API for interacting with SCM systems.
    Integrates Jenkins with CVS version control system using a modified version of the Netbeans cvsclient.
    This plugin integrates GIT with Jenkins.
     
    3.新建项目开始配置步骤:

    1>.源码管理 :SVN更新代码工程与资源 。

    2>.构建触发器,可以不要 指定时间自己构建  Poll SCM  H 22 * * *  【每天22.00点自动构建一次】

    3>.添加Execute Shell 步骤

    cp $WORKSPACE/Tools/PostProcessBuildPlayer $WORKSPACE/code/Assets/Editor/
    chmod +x $WORKSPACE/code/Assets/Editor/PostProcessBuildPlayer

    rm -rf $WORKSPACE/build
    mkdir -p $WORKSPACE/build

    echo Start building Unity project to iOS project..........
    /Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath $WORKSPACE/code -executeMethod PerformBuild.CommandLineBuild -batchmode -quit -logFile $WORKSPACE/build/log.txt

    echo Copy resource to build directory.....
    mkdir -p ${WORKSPACE}/build/iPhone/Data/ClientRes
    cp -r ${WORKSPACE}/ClientRes/Config ${WORKSPACE}/build/iPhone/Data/ClientRes
    cp -r ${WORKSPACE}/ClientRes/Assetbundles_Ios ${WORKSPACE}/build/iPhone/Data/ClientRes
    rm -rf ${WORKSPACE}/build/iPhone/Data/ClientRes/Config/.svn
    rm -rf ${WORKSPACE}/build/iPhone/Data/ClientRes/Assetbundles_Ios/.svn

    python $WORKSPACE/Tools/updateInfo.py ${WORKSPACE}/build/iPhone 0.6 ${BUILD_NUMBER}

    4>.Xcode 工程导出IPA。

    5.

    cd ${WORKSPACE}/build/distributes
    mkdir -p DragonBone-0.6.${BUILD_NUMBER}
    cp *.ipa DragonBone-0.6.${BUILD_NUMBER}

    # Generate .plist file for wireless app distribution
    echo "<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>items</key>
    <array>
    <dict>
    <key>assets</key>
    <array>
    <dict>
    <key>kind</key>
    <string>software-package</string>
    <key>url</key>
    <string>__URL__</string>
    </dict>
    </array>
    <key>metadata</key>
    <dict>
    <key>bundle-identifier</key>
    <string>com.cdkoi.dragon</string>
    <key>bundle-version</key>
    <string>dragon 0.6.${BUILD_NUMBER}</string>
    <key>kind</key>
    <string>software</string>
    <key>title</key>
    <string>Dragon Bone for iOS</string>
    <key>subtitle</key>
    <string>0.6.${BUILD_NUMBER}</string>
    </dict>
    </dict>
    </array>
    </dict>
    </plist>" > "${WORKSPACE}/build/distributes/DragonBone-0.6.${BUILD_NUMBER}/app.plist";
    cp -r ${WORKSPACE}/build/distributes/DragonBone-0.6.${BUILD_NUMBER} ~/distributes

     ===========updateInfo.py 内容===========

    # -*- coding: utf-8 -*-
    #!/usr/bin/python

    import sys
    import os

    PRDUCT_NAME = "XXX"
    CBundleIdentifier = "com.cdkoi.dragon"

    def process_info(info_filename, product_name, bundle_version, build_version):
    info_plist = open( info_filename, 'r' )
    lines = info_plist.readlines()
    info_plist.close()

    info_plist = open( info_filename, 'w' )

    # Now iterate through the project adding any new lines where needed
    i = 0
    stepOneLine = False
    for i in range(0, len(lines)):
    if stepOneLine == False:
    line = lines[i]
    info_plist.write(line)
    stepOneLine = False

    if line.strip() == "<key>CFBundleName</key>":
    info_plist.write( " " + "<string>" + PRDUCT_NAME + "</string>" + ' ' )
    stepOneLine = True

    if line.strip() == "<key>CFBundleDisplayName</key>":
    info_plist.write( " " + "<string>" + PRDUCT_NAME + "</string>" + ' ' )
    stepOneLine = True

    if line == '<key>CFBundleShortVersionString</key>':
    info_plist.write( "<string>1.0</string>" + ' ' )
    stepOneLine = True

    if line == '<key>CFBundleVersion</key>':
    info_plist.write( "<string>1.0</string>" + ' ' )
    stepOneLine = True
    else:
    stepOneLine = False

    info_plist.close()


    # Script start
    print "Starting Modify info.plist with the following arguments..."

    i = 0
    for args in sys.argv:
    print str(i) +': ' + args
    i += 1

    # Check this is an iOS build before running
    if len(sys.argv) == 4:

    info_full_path_name = sys.argv[1] + '/info.plist'
    process_info(info_full_path_name, "龙之骨", "1.0", "1.0")

  • 相关阅读:
    视频智能云组网EasyNTS中sqlite和mysql数据库如何进行相互切换?
    关于github上提出EasyRTSPLive视频网关编译过程中修复README错误
    IPC拉转推流场景中如何实现视频网关EasyRTSPLive试用多通道转换?
    如何使用流媒体接入网关实现拉RTSP流转推RTMP流到流媒体服务器?
    视频流媒体平台采用Go语言编程ioutil.ReadAll的用法注意点
    视频流媒体直播平台EasyDSS运行报Only one usage错误原因排查分析
    视频流媒体播放器EasyPlayer.js截取base64编码快照显示不完整问题解决
    视频流媒体RTMP推流组件在Chorme浏览器无法播放FLV匿名直播流问题分析
    视频流媒体直播点播平台如何获取视频转码信息和进度?
    部署国标GB28181流媒体服务器EasyGBS成功后无法播放视频问题步骤排查
  • 原文地址:https://www.cnblogs.com/j349900963/p/4417250.html
Copyright © 2020-2023  润新知