ADB app uninstall from bootloader


Question

I have a Galaxy Core Duos that I was playing with. It is stock rom, unrooted. However, I installed one app which is crashing the phone after startup. So I cannot use the phone anymore and I need to reset it.



However, I would like to save some data from the phone before. Especially the contacts, which unfortunately haven't been synchronized completely before this app caused crashing.



Is it possible to access my contacts data somehow via ADB from the bootloader/recovery menu? I didn't have ADB enabled in the settings, though. Or is it maybe even possible to uninstall the app from ADB from bootloader/recovery menu?



Or what else could I do?


Answer

No, it is not possible to remove the app from bootloader. ADB daemon is not running in the device in that tiny environment when the device is in fastboot mode and stock recovery doesn't offer shell access.



Your best bet is to flash a custom recovery, such as TWRP, CWM or Philz Touch from fastboot/download mode or from a tool using PC (if at all possible for an ordinary user) and boot straight into that recovery. Note that if the bootloader is not unlocked, unlocking a bootloader may (nowadays it does) cause a full wipe of user's data.



Once you're in a custom recovery environment, follow the instructions to remove the app:




  • mount data partition at /data/, if not already mounted through GUI using volume buttons or touch as appropriate;

  • determine package name of the troublesome app;

  • Using shell or through a file manager feature of your recovery, go to /data/app/ or wherever the app is installed per /data/system/packages.xml or per this answer from Izzy

  • remove the apk or the app's directory (for Android 5.0 and above) containing the apk using the command:



    adb shell rm -rf PATH
    # PATH refers to location of APK under /data/ (excluding /data/media)
    

    #Example:
    adb shell rm -rf /data/app/com.android.chrome-1.apk
    adb shell rm -rf /data/app-private/org.mozilla.firefox/

  • Optional: remove the data of the app from /data/data/ by removing the directory with name as package name of the app using



    adb shell rm -rf /data/data/PACKAGE  # PACKAGE refers to package name of the app

  • If the aforesaid instructions do not work out for you, make the Android boot into safe mode. My answer can help you out.




If you intend to backup contacts, make a backup of the directory /data/data/com.android.providers.contacts. The database inside it contains the contacts. To restore them after a factory reset, boot into a custom recovery and restore the backed up directory.



By the way, it does not matter whether you had USB debugging enabled in Android or not, once you've booted outside of Android OS.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes