• 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 /
avatar image
1
Question by OtmNick · Dec 12, 2013 at 06:11 PM · command line

Command Line Android Build - Graphics Issues

Hi all,

I'm encountering a strange issue with our command-line driven automated android builds. Suddenly, I'm seeing strange graphics issues with command line authored builds that don't appear in builds produced via the Editor.

The code to produce the command line builds is straightforward, and worked flawlessly until very recently. I use the following call:

BuildPipeline.BuildPlayer(scenes, path, BuildTarget.Android, BuildOptions.none);

The sudden divergence between automated builds, and manual builds is puzzling. The glitches seem to involve certain textures containing alpha. I'm not sure what BuildOptions I should specify to produce a build to the same specification as the editor - I assumed (and this seemed valid up until recently) that the project's build settings would be picked up.

Does anyone have any idea as to what the issue might be?

Comment
Add comment · Show 6
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 CHPedersen · Dec 12, 2013 at 06:14 PM 0
Share

That's a good question and one whose answer I'd be interested in, too. I have similar problems, where some objects which are there in manual builds disappear in the automated builds. To begin with, I thought it was because the automated build took place on a virtual server without a real graphics card, and it was failing for some reason because of that. But your post seems to indicate this is not the case.

avatar image ThePunisher · Dec 12, 2013 at 06:18 PM 0
Share

No, the settings from a BuildPlayer call do not read project settings, they overwrite them. What kind of artifacts are you seeing?

avatar image ThePunisher · Dec 12, 2013 at 06:20 PM 0
Share

CHPedersen there is a command line argument for disabling the need for a graphics card. The command is -nographics and it must also use -batchmode. We had the same problem where are servers couldn't build originally because they had no graphics device.

avatar image OtmNick · Dec 12, 2013 at 06:32 PM 0
Share

One example - we have a texture for a semi-transparent light halo around a lamp. On a manual build it looks fine. On the automatically produced build, however, it looks glitchy. There is still transparency, but the texture does not look right at all.

avatar image ThePunisher · Dec 12, 2013 at 06:44 PM 0
Share

Hmm. And the same machine is building AND running both builds? We once had an issue where a particular shader worked fine on my development station but did not function at all in the target hardware. Just trying to eliminate the possibilities here.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by OtmNick · Jan 24, 2014 at 11:29 AM

This issue disappeared when we upgraded Unity to 4.3.3.

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 mhoffmeyer · Jul 31, 2017 at 12:51 PM

Running OSX 10.12.6 Android SDK 25 (7.1.1)

I'm having a similar issue with the latest 5.x and 2017.x versions. I'm able to build the project from Unity, and run the following build script from the IDE with no issue. However, if I run the build script from the CLI, a different sized APK is produced and there are serious graphic issues

CLI Command:

 Unity -nographics -batchmode -projectPath ~/myProject -executeMethod BatchBuild.AndroidBuild -quit -logFile /dev/stdout

Build Script:

 public class BatchBuild : MonoBehaviour {
     static string[] scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray();
 
     [MenuItem("Build/Android")]
     static void AndroidBuild() {
         var outputFile = Path.GetFullPath(Path.Combine(Application.dataPath, @"../output/androidBuild.apk"));
 
         if(File.Exists(outputFile)){
             File.Delete(outputFile);
         }
 
         var options = BuildOptions.Development;
 
         BuildPipeline.BuildPlayer(
             scenes,
             outputFile,
             BuildTarget.Android,
             options
         );
     }
 }


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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

19 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

Related Questions

Command Line Build Default Scene 0 Answers

The -systemallocator switch 0 Answers

Where can I find a list of target names that can be used with command line argument -buildTarget 1 Answer

Class could not be found when executing method from command line (-executeMethod) 0 Answers

run exe without play button,exe to run with no "play" button 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges