r/androiddev • u/mikep9082 • Aug 25 '26
Tips and Information Using adb through a folder
I been trying to get this batch file to work but aslo any other command run a adb command through this folder im always getting select an app to use adb. How can I fix this. It only work once for me but after that I keep getting this. Anywhere else works with no issue when Im adb commands
0
Upvotes
1
u/mikep9082 Aug 25 '26
But i can run bin/adb.exe commands through terminal and it works
1
u/mikep9082 Aug 25 '26
So if I would to run a terminal window from the folder where the unlock.bat file is located like adb connect the window pops up to select an app to use adb
1
u/mikep9082 Aug 25 '26
Its kinda hard to explain it all and im learning as I go and asking questions. It seems like what you been saying if tell it to use exactly that name bin\adb.exe it works in the folder
1
u/Hornet-Mountain Aug 25 '26
enum5345 is on the right track, here is the why so you can fix it for good.
"Select an app to open adb" is the Windows shell association picker. It only pops up when something tries to open a file literally named adb with no extension. The Linux/Mac platform-tools bundle ships an extensionless adb binary sitting right next to adb.exe. When your bat (or the shell) runs adb, it grabs that extensionless file, has no idea how to open it, and shows the picker. That is also exactly why adb.exe typed in full works but bare adb does not.
The reason it happens even when you "run adb from that folder": the current directory is searched first, so bare adb resolves to the extensionless file before it ever reaches adb.exe. PowerShell in particular will try to open a file it finds like that, whereas old cmd would just say not recognized, so it depends which shell your terminal opens.
Two fixes, either one is enough:
"Worked once then stopped" usually means the extensionless file got added later, or you started running from inside that folder so the bare name now resolves to it first.
1
u/sarkie Aug 25 '26
CMD /c ADB
Maybe?
I
1
u/enum5345 Aug 25 '26
Make sure you are using adb.exe instead of the linux or mac versions.
1
u/andreresenderocha2 Sep 22 '26
yes use abd.exe
0
u/mikep9082 Aug 25 '26
Its a unlock.bat file that is use to unlock the firestick. Every time the program is running I get that pop up window a lot when it's trying to run. So I been trying to figure it out. Even when I run simple commands like adb connect or something it pops up.
0
u/mikep9082 Aug 25 '26
It work once but the next day it just started doing that.