1. Download our Official Android App: Forums for Android!

[SOLVED] Deleting directories in /system/app using twrp or adb?

Discussion in 'Android Rooting' started by electricpete, Apr 13, 2016.

  1. electricpete

    electricpete Android Expert
    Thread Starter
    Rank:
     #63
    Points:
    393
    Posts:
    2,073
    Joined:
    Jan 7, 2012

    Jan 7, 2012
    2,073
    1,029
    393
    Male
    Electrical Engineer
    BACKGROUND:

    I'm trying to figure out a way to streamline my monthly security update process for my Nexus 6. Here's what I do now:
    • 1 – use fastboot to flash factory image… all partitions except recovery (I keep my twrp recovery)
    • 2 – use recovery/ twrp to flash chainfires SuperSu.zip
    • 3 – Reboot into android system and use root explorer to delete certain directories in /system/app/ (example the Korean IME, the Hindi IME... things I don't need). Deleting these directories is necessary in order to clear space on the system partition before flashing xposed (otherwise flashing xposed gives error message).
    • 4 – use twrp recovery to flash xposed.zip

    The problem is that step 3 takes forever because booting into android system shows “optimizing apps” screen for half and hour… and I’ll have to repeat that all over again after step 4 anyway.​

    QUESTION: How do I delete those directories (in /system/app/) without having to reboot into android system?

    I know there are lots of options but I haven’t quite figured one out yet.
    • I tried using twrp’s file manager… it shows only one directory inside system (bin). It doesn't show any of the many other directories inside system (including app). There must be some setting or permission required to view these files but not sure what it is.
    • Twrp also has a shell option which opens a session directly on the phone. I typed "cd system" to get to system directory, then typed "ls" to list directory contents and again showed only one item the directory named "bin" (same problem seeing files as above). Even if I could find the directory I'm looking for using the shell, I’m not familiar enough with shell commands to know how to delete a directory (I think I recall something about having to mount as r/w but not sure)
    • I think adb can do the same linux shell commands from the pc, but I'm not clear about what I need to do on the phone to establish an adb session (Fastboot works fine in bootloader mode and my pc path variable is set up to locate adb). Do I just boot into twrp and start issuing adb commands from the pc?
    Any suggestions?
    Thanks
     

    Advertisement

    #1 electricpete, Apr 13, 2016
    Last edited: Apr 13, 2016
  2. electricpete

    electricpete Android Expert
    Thread Starter
    Rank:
     #63
    Points:
    393
    Posts:
    2,073
    Joined:
    Jan 7, 2012

    Jan 7, 2012
    2,073
    1,029
    393
    Male
    Electrical Engineer
    Never mind. Search led me to someone with similar question:
    twrp not showing me folders in system folder

    So in twrp, I need to go to "mounts" and check "system" and uncheck "keep system read only", then press "select storage". After that, the contents of system are readable and writeable (deletable) in twrp's file manager.

    I recall the very first time you launch twrp after flashing a new system it asks if you want to "keep system read only". I think I may have answered yes and if I had answered no this step may not have been necessary.

    The interesting thing is that traditional shell commands don't seem to work right to gain access to system in twrp's shell
    # mount -o rw,remount /system
    chmod 0666.
    It appears that twrp overrides these and you have to use twrp's menus to gain r/w access to system.
     
    #2 electricpete, Apr 13, 2016
    Last edited: Apr 13, 2016

Share This Page

Loading...