Uninstall any android apps whit adb windows
A downloadable tool for Windows

This software application (“Android App Uninstaller”) that uses ADB (Android Debug Bridge) show a list of all installed user-level APKs on a connected Android device and allows the user to uninstall them one by one. It supports multiple UI languages, asynchronously loads app labels and icons (by scraping the Play Store when needed), and provides keyboard and button controls for navigation and uninstallation confirmation.
1. Dependencies and Logging
-
Standard libraries:
-
subprocess
,os
,sys
,threading
,tempfile
,platform
,zipfile
,io
,re
,signal
for process control, filesystem, threading, ZIP handling, regex, and clean shutdown. -
logging
for debug/info/error output to the console.
-
-
Third-party packages:
-
requests
andbs4
(BeautifulSoup) for HTTP fetching and HTML parsing of Google Play pages (to scrape app labels and icons). -
PIL
(Pillow) for image loading and resizing. -
tkinter
(withttk
) for building the GUI.
-
Upon start, the script configures a logger to print time-stamped debug and info messages to the console.
2. Internationalization (i18n)
A global LANGUAGES
dictionary maps human-readable language names to all UI strings (window title, column headers, button text, prompts, help text, etc.).
-
Supported languages include English, Simplified Chinese, Hindi, Spanish, Arabic, Bengali, Portuguese, Russian, and Japanese.
-
current_lang
andT
hold the active language selection. -
A dropdown in the UI allows switching
current_lang
, which updates all visible text viaupdate_ui_language()
.
3. Ensuring ADB Availability
The ensure_adb()
function checks first for a local platform-tools
directory:
-
If present, it scans subdirectories for
adb
oradb.exe
and adds it toPATH
. -
Otherwise, it downloads the latest Platform-Tools ZIP from Google based on the host OS, unpacks it, and adds the contained
adb
binary toPATH
. -
Errors in download (e.g. not a ZIP archive) raise a
RuntimeError
recommending manual installation.
4. ADB Command Wrappers
-
run_cmd(cmd)
: Executes a shell command, captures stdout/stderr, and returns(out, err)
as stripped strings. -
get_device()
: Runsadb devices
and parses the output to return the serial of the first connected device, orNone
if none found. -
list_apks()
: Runsadb shell pm list packages -f
and parses lines of the formpackage:/path/to/apk.apk=com.example.pkg
, filtering out the base system APK. Returns a list of(package_name, apk_path)
.
5. Fetching App Labels and Icons
-
get_label(pkg)
:-
Attempts
adb shell dumpsys package <pkg>
and searches for anapplication-label
line. -
If no label found locally, falls back to
fetch_label_from_play(pkg)
.
-
-
fetch_label_from_play(pkg)
: HTTP GET to the Play Store detail page, parsing the<h1>
element for the app’s title. -
fetch_icon_from_play(pkg)
: Scrapes the Open Graph image URL (meta[property="og:image"]
) from the same Play Store page, downloads it, writes it to a temporary PNG, and returns the filename (orNone
on failure).
6. GUI Construction (AppManager
class)
-
Window setup:
-
Title set from
T["title"]
, size400×600
. -
A
ttk.Treeview
lists apps in two columns: icon + label (tree column) and package name. -
A vertical scrollbar linked to the tree.
-
Custom
Treeview
style increases font size and row height for readability.
-
-
Controls beneath the tree (
ctrl_frame
):-
“Uninstall” button.
-
Arrow buttons (“▲” and “▼”) to move selection up/down.
-
“Help” button to show USB debugging instructions.
-
Language dropdown to switch UI language.
-
7. Event Handling and Navigation
-
Keyboard: Up/Down arrows move selection; Enter or double-click triggers
uninstall()
. -
Scroll buttons: On press, start auto-repeating move via
after(…)
; on release, cancel. -
Language change: Selecting a new language key updates
current_lang
, reloadsT
, and callsupdate_ui_language()
. -
Help:
show_help()
pops up amessagebox
with instructions for enabling USB debugging on Android.
8. Loading and Displaying Apps
load_apps()
runs in a background daemon thread to avoid freezing the UI:
-
Checks for a connected device; if none, shows an error dialog.
-
Calls
list_apks()
, then for each(pkg, path)
:-
Retrieves
label = get_label(pkg)
. -
Attempts
icon_file = fetch_icon_from_play(pkg)
, loads and resizes the image to 32×32 for display. -
Inserts a new row into the tree with
iid=pkg
,text=label
,image=tkimg
(if any), andvalues=(pkg,)
.
-
-
Selects the first app in the list by default.
9. Uninstallation Flow
When uninstall()
is invoked on the selected pkg
:
-
Confirmation dialog: “Uninstall {pkg}?” (text from
T
). -
On “Yes”, runs
adb shell pm uninstall --user 0 {pkg}
. -
If output contains
Success
:-
Removes the item from the tree, reselects a neighboring item, and shows a success dialog.
-
-
On failure:
-
Attempts to open a terminal window (
cmd.exe
,xterm
, orgnome-terminal
) to display detailed ADB error output. -
Records the spawned error terminal process in
self.error_procs
. -
Shows an error dialog.
-
In all cases, focus returns to the tree so the user can continue.
10. Shutdown and Cleanup
-
The window’s WM_DELETE_WINDOW protocol is bound to
on_close()
, which:-
Iterates over any lingering error-terminal processes and sends them
SIGTERM
. -
Destroys the Tk root window and calls
sys.exit(0)
.
-
-
The main script also installs signal handlers for
SIGINT
andSIGTERM
to callon_close()
, ensuring a clean exit if the user presses Ctrl+C.
Overall Behavior
-
Start → ensure ADB binary present or downloaded.
-
Launch GUI → asynchronously list all user APKs with labels/icons.
-
Navigate via keyboard or buttons.
-
Uninstall selected app with confirmation and feedback.
-
Switch language or view “How to Enable USB Debugging” help at any time.
-
Exit → cleanly terminate any auxiliary processes.
This tool provides a user-friendly, multi-language interface for bulk or individual uninstallation of APKs on Android devices via ADB, complete with icon scraping and robust error handling.
Download
Click download now to get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.