• 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
Question by AlexQ · Sep 05, 2011 at 01:39 PM · macosxbatchmode

batchbuild fail on Mac OS X in SSH login

Logged on a Mac mini with OS X and run U3D batch build command:

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectPath /Users/alexq/myproject -executeMethod MyClass.BuildMyPlayer

But got an error message:

Unity[776] : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

Comment
Molix

People who like this

1 Show 1
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 Molix · Feb 23, 2012 at 03:39 PM 0
Share

Did you find any solution for this?

4 Replies

· Add your reply
  • Sort: 
avatar image

Answer by woebtz · Oct 19, 2012 at 05:41 AM

I don't know what the error is referring to, but I get that same "kCGErrorFailure" message over an ssh session as user1 when user1 is not actually logged into the desktop (e.g. Mac on OS X login screen).

I'm only trying to launch (and immediately quit) Unity:

 $ /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode
 Thu Oct 18 20:35:07 {COMPUTER} Unity[74611] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
 _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

It seems like:

  • Executing the command as user1 and no users are logged in -> kCGErrorFailure, Unity process hangs indefinitely

  • Executing the command as user1 and user2 is logged in -> kCGErrorFailure, Unity process hangs indefinitely

  • Executing the command as user1 and user1 is logged in -> Unity starts and ends as expected.

What's a little odd about the headless launch is that the Unity app even pops up in the dock for a few seconds.

Comment
Molix

People who like this

1 Show 1 · 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 Molix · Oct 19, 2012 at 02:02 PM 0
Share

Yes that is the workaround I found too (i.e. log in at the server keyboard, lock it and leave). Obviously not great, but something.

avatar image

Answer by dreamychris · Feb 15, 2013 at 07:46 AM

The problem is that the Unity editor requires access to the window server, since it insists on displaying a GUI even in batch mode. Thus, you can't run it from SSH directly.

I had a similar problem with my Jenkins build server. My hacky workaround was to use Applescript to launch a Terminal window and script it to run a secondary shell script (which in turns launches Unity, tails the log, launches xcodebuild, etc.). Obviously a user has to be logged in for this to work, so I also set my Mac to log in automatically at startup.

You can get fancy with output direction and tail -F to pass the log output back to SSH, which makes it mostly seamless, albeit conceptually ugly.

It works fine, but if anyone finds a nicer method I'd certainly be interested.

Comment
Fattie

People who like this

1 Show 1 · 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 flyfisher1952 · Apr 17, 2013 at 03:55 PM 0
Share

dreamychris,

I'm trying to do the exact same thing you're talking about, using jenkins to automate my build for iOS. Could you post your scripts?

thanks, Mike

avatar image

Answer by modamoda · Jul 04, 2013 at 09:26 AM

Maybe this might help you :) I've also encountered same problem and solved it. Now it works perfectly.

Comment
Graham-Dunnett

People who like this

1 Show 0 · 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

Answer by andi.radulescu · Jan 09, 2014 at 06:39 PM

You have to be logged in on the Mac Mini with the same user as the one you ssh.

Comment
unity_ENFdnIo9zdaNbg

People who like this

1 Show 1 · 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 unity_ENFdnIo9zdaNbg · Sep 26, 2018 at 02:48 PM 0
Share

It is work for me

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

batchbuild fail on Mac OS X in SSH login 1 Answer

Running Mac Standalone Player In Batchmode 1 Answer

Unity3d crashes in batchmode from a null string 1 Answer

mods to unity kinda? 3 Answers

Forcing Unity expiration? 2 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