- Home /
unity crashes on exit
This seems to happen at random, and I've had it on both of my machines and the machines at my uni, so I'm pretty sure it's not a problem with the machine (though I could be wrong).
Basically what happens is, when I exit unity, by clicking the x in the top corner or alt-f4, the editor just hangs indefinitely and task manager instantly reports it as not responding.
This has happened on windows xp, 7, 8 and 8.1, with unity 4.3 and every update since.
Anybody know of what could be causing this and/or possible fixes, it would be greatly appreciated.
same thing happens to me since i updated to 4.3, i don't think it's our fault, i'm just waiting for another update
Answer by haim96 · Dec 16, 2013 at 09:44 PM
kill the adb.exe process and then close UNITY.
it's adb.exe *32 if you have 64bit system... if you already closed unity and it hanged. just close the process and unity will be closed as well.
kind of... and it's not a solution. only a work around. i think unity guys still need to work it out.
thanks for the work around, would be nice if there was a proper fix though
This answer solved it for me if I launch Unity from a batch file that first loads adb! Also, this Issue Tracker status is closed. Do we need to re-file the issue?
Answer by twburger · Mar 15, 2014 at 01:05 AM
As of 4.3.4f1 it still exists as a bug. Need to run taskkill /IM adb.exe /F Seems to be a questions of the "WRONG" version of ADB.EXE from what I have read, but which is the "RIGHT" one? This powershell script fixes it:
start-process "D:\Program Files (x86)\Unity\Editor\Unity.exe"
$unity = get-process unity
$adb = $NULL
do {
$adb = get-process adb
if($adb)
{
Stop-Process $adb.id
}
Start-Sleep -m 5000
$unity = get-process Unity
} while( $unity -ne $NULL )
HOW TO RUN IT: Create a shortcut with this in it
powershell.exe -windowstyle hidden -File "D:\Program Files (x86)\Unity\unity.ps1"
Files here: FILES
Answer by 1elfdragon1 · Mar 19, 2014 at 10:34 AM
(windows) open notepad, and paste this
("Name" = your account name)
(Program Files (x86) can also be Program Files, depends on your hardware)
.
@echo off
cd C:\\Users\\"Name"\\AppData\\Local\\Android\\android-sdk\\platform-tools
adb devices
cd C:\\Program Files (x86)\\Unity\\Editor
start Unity.exe
Exit
Answer by Kempain · Nov 15, 2014 at 06:32 PM
I had a very similar problem which was resolved just by adding the location of ABD as a system path. Tried the above script and realised that ADB wasn't even running.
Once I added the location of ADB as a system path, I'm guessing Unity could then find and start/stop it itself so the crash on exit was resolved for me. I didn't need to use the above script after that.
To add ADB to your system path: 1. Open command prompt as admin 2. Type: setx PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools" (change location of ADB as required)
The above fixed the crash problem for me on Windows 8.1 and I also force DX11 to make Unity more stable on Windows 8.1.
I'm also not sure if Unity installs the Android dev tools because I already had those installed so if you can't find ADB and have the same problem I would suggest installing the Android dev tools as per the below article then setting the system path to ADB.
Your answer
![](https://koobas.hobune.stream/wayback/20220613124308im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Editor crashing when editing scripts referenced from GameObjects 1 Answer
unity is crashing when I open my project 1 Answer
How can I fix/stop my Unity from crashing when using the Unity inspector? 0 Answers
Text missing in Editor; huge amounts of bugs and glitches 0 Answers
Object limit in Editor (crash) 1 Answer