After closing Unity, adb.exe continues to run, locks my project folder...

Has anyone else noticed this? If I try to commit or zip up or copy my project folder after exiting Unity I get a file lock error in windows, if I open my task manager and kill the adb.exe process (android) I can then move/copy/zip/etc my folder. Funny thing is I’m not even building for android, its for windows.

I saw that a few other people on the forums (searched) have some crash/hang problems with adb.exe, but mine seems different as its not closing the process once unity exits out. It does this on my laptop as well so I’m leaning towards it being a Unity thing.

I also sometimes get this, I have to kill adb.exe from Task Manager before I’m able to run with networking again.

I just got the latest version today 4.3.3f1, it has this as one of the fixes:

“Editor: Quitting the editor should no longer be blocked by adb.exe on windows.”

This is still an issue for me. I’m running on Windows 7 64bit with the Android SDK Tools rev. 22.3 and Platform-tools 19.0.1

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:

File unity.ps1

While the Unity process runs check for adb.exe and if running

kill the task

run the Unity IDE

start-process “D:\Program Files (x86)\Unity\Editor\Unity.exe”

get the unity process

$unity = get-process unity

set do while control value checking if Unity is running

$adb = $NULL

do
{

get the ADB.EXE process

$adb = get-process adb

if($adb) ## if adb is running stop it ##
{
Stop-Process $adb.id
}

Sleep for 5 seconds

Start-Sleep -m 5000

check if Unity is running

$unity = get-process Unity

if Unity is not running then exit

} while( $unity -ne $NULL ) ## or while($unity) ##

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

i am surprised they still havent fix this issue since many months ago…

Yeah, it still happens in Unity 4.3.4f1. The Unity becomes unresponsive after exiting. The only way is to kill adb in task manager.

I’m using Windows 8.1 Pro.

Have to kill ADB.EXE to continue.
Each time I close or I change projects.
:face_with_spiral_eyes:

This should be fixed in the 4.3.7 p1 release: http://forum.unity3d.com/threads/246198-Unity-Patch-Releases

Nope, still happens 4.5.2p2

still happens for me too. 4.5.2

Can you report this bug again with the current version of the editor.

I’m seeing it on Unity 2017.3.0f3 and 2017.3.0p1. Regression?

Started seeing this again in 2019.4 after running an automated build

1 Like