<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>eraserqueen&#39;s brain dump</title>
    <description>Posts about dev things I keep forgetting and re-learning again.
</description>
    <link>http://eraserqueen.github.io/</link>
    <atom:link href="http://eraserqueen.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 05 Aug 2016 01:09:12 +0000</pubDate>
    <lastBuildDate>Fri, 05 Aug 2016 01:09:12 +0000</lastBuildDate>
    <generator>Jekyll v3.1.6</generator>
    
      <item>
        <title>Making a 3d model into a Gear VR app</title>
        <description>&lt;p&gt;In this case we wanted to turn a 3d architecture model into a VR experience.&lt;/p&gt;

&lt;h2 id=&quot;get-your-3d-model-ready&quot;&gt;Get your 3d model ready&lt;/h2&gt;
&lt;p&gt;I downloaded a free sample from http://tf3dm.com/3d-model/interior-room-72962.html
Unity can import exported formats such as .obj, but also some proprietary formats (Maya, 3DSMAx, Blender…)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;[https://docs.unity3d.com/Manual/3D-formats.html&quot;&gt;source: Unity Docs&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;import-to-unity&quot;&gt;Import to Unity&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Create a new 3D project&lt;/li&gt;
  &lt;li&gt;Go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Assets &amp;gt; Import New Asset...&lt;/code&gt; and locate your model&lt;/li&gt;
  &lt;li&gt;It will show up in your Asset folder&lt;/li&gt;
  &lt;li&gt;Drag and drop onto your scene&lt;/li&gt;
  &lt;li&gt;Adjust your camera position/angle :
    &lt;ul&gt;
      &lt;li&gt;move your view the way you want it&lt;/li&gt;
      &lt;li&gt;select the Main Camera object&lt;/li&gt;
      &lt;li&gt;Go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Game Object &amp;gt; Move to view&lt;/code&gt; (Ctrl+Alt+F)&lt;/li&gt;
      &lt;li&gt;Go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Game Object &amp;gt; Align with View&lt;/code&gt; (Ctrl+Shift+F)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;http://eraserqueen.github.io/assets/2016-08-05-assets.jpg&quot; alt=&quot;Imported asset&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;update-project-settings-for-vr&quot;&gt;Update project settings for VR&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Go to &lt;code class=&quot;highlighter-rouge&quot;&gt;Edit &amp;gt; Project Settings &amp;gt; Player&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;in the Inspector panel, click on the Android button, then under “Other Settings” check “Virtual Reality Supported”&lt;/li&gt;
  &lt;li&gt;in the same panel, fill in “Bundle Identifier”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;http://eraserqueen.github.io/assets/2016-08-05-inspector.jpg&quot; alt=&quot;Imported asset&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;get-a-signature-file&quot;&gt;Get a signature file&lt;/h2&gt;
&lt;p&gt;To run VR apps in the GearVR you need a signature file linked to your device or you’ll receive the following message at runtime: &lt;code class=&quot;highlighter-rouge&quot;&gt;thread priority security exception make sure the apk is signed&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;find out your device id
    &lt;ul&gt;
      &lt;li&gt;there’s an &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.skyworxx.sideloadvrdeviceid&amp;amp;hl=en&quot;&gt;app for that&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;on MacOS, connect your device to your computer and run the command &lt;code class=&quot;highlighter-rouge&quot;&gt;adb device&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;on Windows, you’ll have to dig in the device manager (&lt;a href=&quot;http://www.gilsmethod.com/how_to_resolve_unknown_device_problems&quot;&gt;tutorial here&lt;/a&gt;)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Once you have your device id, go to https://developer.oculus.com/osig/ and generate the file&lt;/li&gt;
  &lt;li&gt;save it to &lt;YourProject&gt;/Assets/Plugins/Android/assets/&lt;/YourProject&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/32045009/thread-priority-security-exception-make-sure-the-apk-is-signed&quot;&gt;source: StackOverflow&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;build-your-app&quot;&gt;Build your app&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;connect your phone&lt;/li&gt;
  &lt;li&gt;go to &lt;code class=&quot;highlighter-rouge&quot;&gt;File &amp;gt; Build Settings...&lt;/code&gt; and select “Android” with “Development Build” checked&lt;/li&gt;
  &lt;li&gt;click Build, doesn’t matter where you save the file&lt;/li&gt;
  &lt;li&gt;your phone should be detected automatically and the apk pushed directly onto it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;http://eraserqueen.github.io/assets/2016-08-05-build.jpg&quot; alt=&quot;Imported asset&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;run-the-app-from-your-phone&quot;&gt;Run the app from your phone&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;tap the newly installed app&lt;/li&gt;
  &lt;li&gt;you might have to install the GearVR app and tap “Allow” when prompted with security dialogs&lt;/li&gt;
  &lt;li&gt;Once instructed, attach your phone to the GearVR and enjoy your VR room&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 05 Aug 2016 00:30:00 +0000</pubDate>
        <link>http://eraserqueen.github.io/unity/vr/2016/08/05/making-3d-model-into-gearvr-app.html</link>
        <guid isPermaLink="true">http://eraserqueen.github.io/unity/vr/2016/08/05/making-3d-model-into-gearvr-app.html</guid>
        
        
        <category>unity</category>
        
        <category>vr</category>
        
      </item>
    
      <item>
        <title>Building a Unity3D VR project with Teamcity</title>
        <description>&lt;h2 id=&quot;the-project&quot;&gt;The project&lt;/h2&gt;
&lt;p&gt;A virtual reality game for the Samsung GearVR, using Unity3D, Oculus SDK, Android SDK.
The project is in a public repo on github, and I want Teamcity to build it on every check-in and run unit tests.&lt;/p&gt;

&lt;h2 id=&quot;step-1-unit-testing-in-unity&quot;&gt;Step 1: Unit testing in Unity&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;TODO: talk about Test project&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;step-2-building-from-command-line&quot;&gt;Step 2: Building from command line&lt;/h2&gt;
&lt;p&gt;According to the &lt;a href=&quot;https://docs.unity3d.com/Manual/CommandLineArguments.html&quot;&gt;Command line reference&lt;/a&gt; there’s no option to build an Android player directly. Instead, we’ll have to use a custom method to publish our APK, and call it with the &lt;code class=&quot;highlighter-rouge&quot;&gt;-executeMethod&lt;/code&gt; argument.
Our build command looks like this:
&lt;code class=&quot;highlighter-rouge&quot;&gt;
&quot;C:\Program Files\Unity\Editor\Unity&quot; 
-projectPath &quot;C:\Path\To\Project&quot; 
-logfile &quot;C:\Path\To\Project\build.log&quot; 
-executeMethod AndroidBuilder.Build
-batchmode
-quit
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In Unity, under the “Scripts” folder (create it if missing), add a new C# script called “AndroidBuilder” and open it with your preferred IDE.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;the class must be &lt;code class=&quot;highlighter-rouge&quot;&gt;static&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;you don’t need the default methods &lt;code class=&quot;highlighter-rouge&quot;&gt;Start&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;Update&lt;/code&gt; because we’ll only call this from the command line. In our case the starting point is a method called &lt;code class=&quot;highlighter-rouge&quot;&gt;Build()&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-c# highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outputPath&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Application&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dataPath&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/../myProject.apk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;Debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Publishing Android Player in &quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#if UNITY_EDITOR
&lt;/span&gt;      &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scenes&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;EditorBuildSettings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scenes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scene&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scene&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;BuildPipeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;BuildPlayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scenes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;BuildTarget&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Android&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;BuildOptions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Development&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#endif
&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;note the &lt;code class=&quot;highlighter-rouge&quot;&gt;#if UNITY_EDITOR&lt;/code&gt; clause: this is because the Unity API is separated into UnityEditor and UnityEngine, and the compiler only knows how to deal with UnityEngine. We can still use classes from the UnityEditor assembly, as long as we wrap them in that clause. &lt;a href=&quot;http://unityready.com/use-unity_editor-write-editor-code-game-scripts/&quot;&gt;reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;step-3-setting-up-the-build-server&quot;&gt;Step 3: Setting up the build server&lt;/h2&gt;

&lt;p&gt;I found out there’s no easy way to avoid Windows for this: I first tried setting up a Linux machine, but Teamcity needs a local instance of Unity to build the project, and their Linux version is experimental. As for MacOS, although unity3d is supported, the Oculus SDK we use for the VR part of the project is not.&lt;/p&gt;

&lt;h1 id=&quot;intall-teamcity-server&quot;&gt;Intall Teamcity Server&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Run the &lt;a href=&quot;https://www.jetbrains.com/teamcity/&quot;&gt;windows installer&lt;/a&gt;, you can keep all default settings. I like to hostfile my server to be something like http://teamcity.local&lt;/li&gt;
  &lt;li&gt;Visit the Teamcity home, set up your admin account&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;install-teamcity-agent&quot;&gt;Install Teamcity Agent&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;For simplicity I am hosting the server and the build agent on the same machine but you can separate them of course.&lt;/em&gt;
- Click on “Agents” in the top navigation, then “Install Build Agents” in the top right corner, choose “MS Windows Installer”
- Run the installer, again all defaults is fine (make sure that the server url is correct if you chose a custom one in the previous step), we’re only going to use one agent.&lt;/p&gt;

&lt;h1 id=&quot;create-project-and-configuration&quot;&gt;Create project and configuration&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;In “Administration” click “Create Project” and give it a name&lt;/li&gt;
  &lt;li&gt;In Administration &amp;gt; Root &amp;gt; MyProject
    &lt;ul&gt;
      &lt;li&gt;under “Build configurations” click “Create Build Configuration”, call it something like “MyProject_CI”&lt;/li&gt;
      &lt;li&gt;In Administration &amp;gt; Root &amp;gt; MyProject &amp;gt; MyProject_CI
        &lt;ul&gt;
          &lt;li&gt;in the left-hand menu click “Version Control Settings”, then “Attach VCS root” and fill in your repository credentials&lt;/li&gt;
          &lt;li&gt;in the left-hand menu click “Triggers”, then “Add a new trigger”. Choose “VCS trigger” and click “Trigger a build on each check-in” then save.&lt;/li&gt;
          &lt;li&gt;in the left-hand menu click “Build Step” then “Add a build Step”. Choose “Command Line” and add the following:&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;C:\Program Files\Unity\Editor\Unity&quot;&lt;/code&gt;&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-projectPath &quot;%teamcity.build.checkoutDir%&quot;&lt;/code&gt; is where your project files are checked out by Teamcity&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-logfile &quot;%teamcity.build.checkoutDir%\unity.build.log&quot;&lt;/code&gt; will generated a log for each build that we can later add to the artifacts list&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-executeMethod AndroidBuilder.Build&lt;/code&gt; will run the custom “publish to android” script&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-batchmode&lt;/code&gt; makes the build silent instead of launching the editor&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-nographics&lt;/code&gt; allows the build to run on servers without GPU&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-runEditorTests&lt;/code&gt; runs unit tests&lt;/li&gt;
          &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-quit&lt;/code&gt; ensures unity exits after building the project (it hangs by default, because… reasons?)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;display-test-results&quot;&gt;Display Test Results&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;In Administration &amp;gt; Root &amp;gt; MyProject &amp;gt; MyProject_CI, in the left-hand menu click “Build Features” then “Add build feature”.
    &lt;ul&gt;
      &lt;li&gt;Select “XML report processing”&lt;/li&gt;
      &lt;li&gt;report type: NUnit&lt;/li&gt;
      &lt;li&gt;Monitoring rules: &lt;code class=&quot;highlighter-rouge&quot;&gt;%teamcity.build.checkoutDir%\EditorTestResults.xml&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;list-artifacts&quot;&gt;List Artifacts&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Let your build run once for easier selecting&lt;/li&gt;
  &lt;li&gt;In Administration &amp;gt; Root &amp;gt; MyProject &amp;gt; MyProject_CI, click “general settings”&lt;/li&gt;
  &lt;li&gt;Click on the “folder tree” icon next to “Artifacts path” and select the APK file&lt;/li&gt;
  &lt;li&gt;the APK will now show as an artifact of your future builds for easy downloading&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;step-4-use-teamcitys-build-number-to-version-your-apk&quot;&gt;Step 4: Use Teamcity’s build number to version your APK&lt;/h2&gt;
&lt;p&gt;Command line builder accepts arbitrary arguments: it will just ignore them. This lets us add a &lt;code class=&quot;highlighter-rouge&quot;&gt;-buildNumber&lt;/code&gt; argument to the command line that we will retrieve in our custom publication script to define the APK version number.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;In Administration &amp;gt; Root &amp;gt; MyProject &amp;gt; MyProject_CI &amp;gt; Build Step  edit the current command line step to add the following argument: &lt;code class=&quot;highlighter-rouge&quot;&gt;- &quot;%build.number%&quot;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;In the Unity project, we will add a method to the AndroidBuilder class to retrieve command line arguments&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-c# highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;GetArgumentFromCommandLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameterName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultValue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arguments&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetCommandLineArgs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;IndexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parameterName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;defaultValue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ArgumentException&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Could not find argument &#39;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameterName&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&#39; in command line.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;then modify the Build() method:&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-c# highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;outputPath&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Application&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dataPath&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/../myProject.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetArgumentFromCommandLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;buildNumber&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)+&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;.apk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Wed, 13 Jul 2016 23:55:45 +0000</pubDate>
        <link>http://eraserqueen.github.io/unity/ci/2016/07/13/building-unity-project-teamcity.html</link>
        <guid isPermaLink="true">http://eraserqueen.github.io/unity/ci/2016/07/13/building-unity-project-teamcity.html</guid>
        
        
        <category>unity</category>
        
        <category>ci</category>
        
      </item>
    
  </channel>
</rss>
