The use of Jenkins in the Unity3d Institute (78)

Source: Internet
Author: User

Long night long unintentional sleep, to an article hehe. I believe that if you have a shell script to complete the iOS and Android packaging friends must need Jenkins

How to make planning to pack IPA and apk? How to completely eliminate the time of the program, as long as the same LAN does not need unity development environment, as long as it has a browser, it can pack Jenkins is undoubtedly the best choice.

Unity3d Institute of iOS automatic editing framework, plist, OC Code (67)

Unity3d Institute of iOS Automatic Packaging Generation IPA (68)

Unity3d Research Institute's Android automatic package Generation APK (69)

First of all to find a package dedicated computer most packaged server, this computer is best Mac because Windows can not play iOS package. Deploying Jenkins and Unity's development environment on this computer allows Jenkins to execute our fully automated packaged shell scripts. At the same time Jenkins generates a Visual Web site inside the LAN, which allows the planner to log on to perform the packaged operation.

There are two ways to install Jenkins

Method One: http://jenkins-ci.org/on the official web directly download the DMG installation package for Mac can be completed in this machine to build Jenkins work. But Jenkins will not use your native user to build, and what that means is that Jenkins can't open unity, nor can it adjust the script method written by unity itself.

http://blog.csdn.net/wirelessqa/article/details/8647771 can be solved according to the method of this article.

#停止Jenkins
$ sudo launchctl unload/library/launchdaemons/org.jenkins-ci.plist
# Modify group and user
$ sudo vim +1 +/daemon + ' s/daemon/staff/' +/daemon + ' S/daemon/bixiaopeng ' +wq org.jenkins-ci.plist
$ sudo chown-r bixiaopeng:staff/users/shared/jenkins/
# Start Jenkins
$ sudo launchctl load/library/launchdaemons/org.jenkins-ci.plist

It means you have to change the GroupName and username inside the org.jenkins-ci.plist into your own.

You can have it in your preferences.

Then you can see your group (group) and username (account name) My group is staff and my username is MOMO.

Method Two: Install with brew

Perform brew install Jenkins and you will see some information about the installation.

After the installation is done

Java-jar/usr/local/opt/jenkins/libexec/jenkins.war

In the browser open http://localhost:8080/LAN inside someone else can open http://"Your IP" 8080/

Choose the parametric build process, where you can add some options for planning operations. Then add the build step and choose execute shell to execute the shell script. Command inside is the script and parameters that need to be executed. /users/momo/test.sh is the full path of the shell script in this machine, $version is to pass the planned version number to the shell script in.

Select Build with Parameters to the right to select a version number which is the parameter we configured above. Click to start the build on OK. After the build is complete, you can select console output below to view the completed log for the build

Here's the log.

In addition Jenkins provides the account system, it is best to use the person to register the account number, otherwise anyone can http:/"Your IP," 8080/This page point is not good.

Shell Script

123456789101112131415161718192021 #!/bin/shecho "Start" #unityapp的路径export untiy=/applications/Unity4. 5.1/Unity. App/Contents/MacOS/Unity #项目路径export ProjectPath=/Users/MOMO/testunity #把所有 = The following parameters are taken outfor A in $* Dor='echo $a | sed "s/--//g"' eval $r Done#这里就可以拿到jenkins传递进来的参数了echo "version = $version" #打开unity3d Execute the Myeditorscript.mymethod method. #unity产生log就写在tmp/1.log, such as Debug.Log and unity editor generated. $untiy -quit -batchmode -projectpath $ Projectpath -logfile /tmp/1.log  - Executemethod myeditorscript "$version"

There are also places in unity that receive shell calls. Myeditorscrip This class is placed under the editor directory.

12345678910111213 using unityeditor; using unityengine; class myeditorscript {static void MyMethod () {string executemethod = "Myeditorscript.mymethod"; foreach(string arg in System. Environment. GetCommandLineArgs()) { Debug. Log(arg); }}}

It's almost loadline. In addition, in the shell script can also use SVN up svn ci and other commands to perform the update and upload operations, Jenkins quickly use it.

    • This article fixed link: http://www.xuanyusong.com/archives/3349

The use of Jenkins in the Unity3d Institute (78)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.