Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by aventurella · Jun 11, 2016 at 01:54 PM · iosbuildcirclecontinuous-integrationautomated

Unity Automated / Command Line Build fails to output iOS / Xcode Project

So I have a CI build system setup for a unity project, however it seems that I am doing something wrong the I go to build the project from the command line. The doesn't error out, but it also doesn't generate the expected iOS files.

So for starters I am using CircleCI as my build platform, using their OS X build machines. If I run the build script locally it works, it's only when I run it from the CI box that it fails. By fails I mean does not output anything. There appear to be no explicit errors in the log.

I have the machine setup as follows:

 machine:
   environment:
     GYM_CODE_SIGNING_IDENTITY: "iPhone Distribution: Acme Inc. (FAKEVALUE)"
     XCODE_SCHEME: "Unity-iPhone"
     XCODE_PROJECT: "Unity-iPhone.xcodeproj"

   pre:
     - curl -o Unity.pkg http://netstorage.unity3d.com/unity/960ebf59018a/MacEditorInstaller/Unity-5.3.5f1.pkg
     - curl -o Unity-iOS.pkg http://netstorage.unity3d.com/unity/960ebf59018a/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-5.3.5f1.pkg
     - sudo installer -dumplog -package Unity.pkg -target /
     - sudo installer -dumplog -package Unity-iOS.pkg -target /

   xcode:
     version: "7.3"

 test:
   override:
     - mkdir -p Unity/Builds/iOS
     - /Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -quit -nographics -projectPath $PWD/Unity/MyProject -logFile /dev/stdout -executeMethod CommandLineBuild.iOSBuild


I'm omitting the deployment configuration as it always fails since the CommandLineBuild.iOSBuild fails to output the iOS project.

Here is the contents of that build script, first the short version:

 using UnityEngine;
 using UnityEditor;
 using System.Linq;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;

 public static class CommandLineBuild {

     [MenuItem("File/CommandLineBuild/iOS")]
     static void iOSBuild ()
     {
         EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iOS);
         var scenes = { "Assets/Scenes/SplashScreen.unity" };
         var opts = BuildOptions.None;
     
         BuildPipeline.BuildPlayer(scenes, "../Builds/iOS", BuildTarget.iOS, opts);
     }
 }

This didn't work in it's simple form, again the problem is that the iOS Xcode project is not output.

So then I tried to get fancier, and add additional options thinking that was the issue:

 using UnityEngine;
 using UnityEditor;
 using System.Linq;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;

 //0 - ARMv7
 //1 - ARM64
 //2 - Universal

 // http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-9#post-1948394
 enum ArchitectureValue {
     ARMv7,
     ARM64,
     Universal
 }

 public static class CommandLineBuild {

     [MenuItem("File/CommandLineBuild/iOS")]
     static void iOSBuild ()
     {
         EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iOS);

         PlayerSettings.companyName = "MyCompany";
         PlayerSettings.productName = "MyProject";
         PlayerSettings.bundleVersion = "1.0";
         PlayerSettings.iOS.buildNumber = "101";
         PlayerSettings.statusBarHidden = true;
         PlayerSettings.useAnimatedAutorotation = true;
         PlayerSettings.bundleIdentifier = "com.mycompany.MyProject";
         PlayerSettings.iPhoneBundleIdentifier = "com.mycompany.MyProject";


         PlayerSettings.iOS.targetDevice = iOSTargetDevice.iPhoneAndiPad;
         PlayerSettings.iOS.appInBackgroundBehavior = iOSAppInBackgroundBehavior.Suspend;
         PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;
         PlayerSettings.iOS.targetOSVersion = iOSTargetOSVersion.iOS_6_0;
         PlayerSettings.iOS.allowHTTPDownload = true;
         PlayerSettings.iOS.requiresFullScreen = true;

         // http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-9#post-1948394
         PlayerSettings.SetPropertyInt(
             "ScriptingBackend",
             (int)ScriptingImplementation.IL2CPP, 
             BuildTargetGroup.iOS
         );

         PlayerSettings.SetPropertyInt(
             "Architecture",
             (int)ArchitectureValue.Universal, 
             BuildTargetGroup.iOS
         );

         string[] scenes = { "Assets/Scenes/SplashScreen.unity" };
         var opts = BuildOptions.Il2CPP;
     
         BuildPipeline.BuildPlayer(scenes, "../Builds/iOS", BuildTarget.iOS, opts);
     }
 }


Anyway, under both build scripts the result is the same. It runs, no errors are in the logs, but also not Xcode Project is output.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by circleciGeorge · Nov 18, 2016 at 07:43 AM

Hi @aventurella/ @nephenmaat,

This is more or less a copy/paste of the response on the CircleCI forums, but figured this might help out the people who check this here instead of there. I also won't check this as often as the CircleCI forums :p.

Sorry for taking so long to respond to this. I recently went through and created a sample project to highlight your issues and had the same problem. You are right that you need to remove the -nographics as I believe iOS builds require a graphics driver of some sort. After removing -nographics, I got the following two errors in the log files:

Building a player for 'iPhone' (9) target is not supported in this Unity build

Switching to iOSSupport is disabled

It turns out that Unity requires a pro license in order to build iOS projects. I don't believe there is any other way. After adding in my serial,username,and password the builds worked great. You can see my example project here: https://github.com/GERey/Simple-Mobile-Application. Let me know if you have any further questions!

Best, George

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by aventurella · Jun 11, 2016 at 10:15 PM

ok, so it seems like -nographics maybe have been the problem. Now however it wants me activate a license?

This may be me just misunderstanding the difference between Pro/Personal. I guess they don't want you to do automated builds on Personal?

 DisplayProgressbar: Unity license
 Cancelling DisplayDialog: Failed to activate/update license. Missing or bad username and password. Please try again using valid credentials or contact support@unity3d.com
 This should not be called in batch mode.
  
 (Filename: /Users/builduser/buildslave/unity/build/Editor/Platform/OSX/EditorUtility.mm Line: 729)


I can pass my -username and -password (no -serial) and it still fails (assuming I need that serial).

Anyway is that the issue here, only Pro lets you do automated builds? Is there a way to activate unity with a personal license from the command line?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by nephenmaat · Oct 25, 2016 at 08:03 AM

the same problem, i have not found how to fix this yet, so bad.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

74 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

IOS build don't render objects with scale different than 1 0 Answers

Null Reference Exception in iOS build for some users. Not in Editor and cannot duplicate 0 Answers

How do I access [Link Binary With Libraries] within Build Phases in Xcode with PBXProject? 2 Answers

Build for iOS 0 Answers

How can i upload an iOS build using post build script in cloud build ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges