Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
4
Question by nick.wilmes · Apr 14, 2015 at 10:19 PM · command-line

Why does unity keep hanging when run through the command line?

I have been using the fairly new Unity Test Tools to write tests for one of our features and while it works when running through the GUI in unity, I have been running into issues when triggering this through the command line for automation purposes using Jenkins.

Everything seems to be going ok until it gets to the end, at which point it hangs at the following point:

 Writing results to file...
 Batchmode quit successfully invoked - shutting down!
 System memory in use before: 0.86 GB.
 Unloading 1 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
 System memory in use after: 0.86 GB.
 
 Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 859.
 Total: 7.906044 ms (FindLiveObjects: 0.039674 ms CreateObjectMapping: 0.042262 ms MarkObjects: 5.027706 ms  DeleteObjects: 0.012314 ms)
 
 Refresh, detecting if any assets need to be imported or removed ... 0.006445 seconds (Nothing changed)
 Cleanup mono
 
 
 

This only seems to happen at random times, more often when I’m running our larger test suite. Any suggestions you have to help diagnose this problem would be great.

Comment
Add comment · 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 zapjonny · Jul 22, 2016 at 06:05 AM 0
Share

Happens to me now also when running a build from command line. Or specifically through Jenkins.

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Dave-Hampson · Apr 22, 2015 at 09:59 AM

If you have -quit on the command line then this sounds like a bug

Some guidelines for submitting bugs are here: http://answers.unity3d.com/questions/578888/how-can-i-report-a-bug-most-effectively.html

(As a workaround, kill the Unity process)

edit Is it ADB.EXE which is blocking shutdown?

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 jiguangdongyu · Oct 19, 2016 at 08:59 AM

I have faces this problem because I run wrong command line "-excuteMethod", not "executeMethod"...

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 tudonca · Aug 01, 2019 at 02:40 PM

I had the same issue on Unity 2018.4

I was able to fix this by manually calling AssetDatabase.Refresh() at the end of my build script, before Unity initiates the batchmode shutdown.

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 Ryu8179 · Oct 29, 2021 at 11:48 AM

I had the same problem with Unity 2021.2.0b8. adb.exe was blocking it. (I confirmed that killing the adb.exe process from Task Manager solved the hang tentatively.)

In my case, I was running UnityBuild from a Windows batch file and had a problem with Cleanup mono hanging when running UnityBuild in the scope of setlocal enabledelayedexpansion ~ endlocal as shown below.

PlayerBuild.bat

 setlocal enabledelayedexpansion
 .
 . other code
 .
 "C:\UnityEditor\2021.2.0b8\Editor\Unity.exe" -batchmode -buildTarget Android -quit -logFile - -projectPath %WORKSPACE% -executeMethod JenkinsBuild.Build
 .
 . other code
 .
 endlocal

Removing setlocal enabledelayedexpansion ~ endlocal solved this problem.

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 aimatme · Dec 14, 2021 at 02:51 PM

Same problem (hangs at the cleanup mono) with Unity 2021.2.6 in Windows Editor batchmode with -quit

adb.exe is in process list, but I cant solve the problem with described solutions

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

8 People are following this question.

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

Related Questions

Command line error 1 Answer

Error on android game building, Win32Exception: ApplicationName='F:/Android SDK\tools\zipalign.exe', CommandLine='4 5 Answers

Update to 5.3.4f1 executeMethod couldn't be find in Command line arguments 0 Answers

Unity Command Line Fails to Get license 1 Answer

No graphics in build with -batchmode -nographics 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