How to delete some files on unbootable phone with low memory? I had been ignoring low memory on my android phone (Nexus 6P running copperhead OS) for some time.

OS suddenly crashed out of no where and started booting up infinitely. After forcing it to restart and entering the password for decryption, phone never finishes the boot procedure. Seems that due to zero or very less space, some error must be occurring, which doesn't let the OS finish the boot procedure.

It's my assumption that low memory could have been the issue, so trying to find a way to delete files and let OS have some space to boot up.

(1) Bootloader is locked. I can see "Device is LOCKED." at bootloader screen. So, unable to boot latest TWRP via fastboot boot twrp.img. Receiving error FAILED (remote: unlock device to use this command)

(2) ADB sideload option available in copperhead OS recovery doesn't allow any random update.zip. Tried to run an updater script but it fails. It seems that recovery is validating the package. Errors are E: footer is wrong, E: Signature verification failed, E:error: 21 Installation aborted

(3) Tried to find some vulnerabilities which let bypass security features, but didn't find any except this which has been fixed in bootloader angler-03.79 being used.

(4) Phone is running an old android OS : 8.1.0 June 2018 AOSP build, and since then there could be security vulnerabilities being introduced. So are there any vulnerabilities or exploits which can be helpful here?
You can ask the OEM developers if they can help with an official solution. Problem is the 1st Level Support will always deny such requests. You can request the source code instead (in compliance with the GPL) and if you are lucky you will get direct contact (email address) to any developer this way instead.

OEM could easily provide (signed) emergency-update.zip containing following files  


  META-INF/com/google/android/updater-script  

ifelse(is_mounted("/data"), ui_print("deleting cache files..."), abort("ERROR: Data not mounted"));
package_extract_dir("tmp", "/tmp");
set_perm_recursive(0, 2000, 0755, 0755, "/tmp");
run_program("/tmp/rmcache.sh");
ui_print("done");

  
  tmp/rmcache.sh  

#!/bin/sh
/tmp/busybox find /data/data -type d -iname cache -exec /tmp/busybox find {} -type f -print -delete +

  
  tmp/busybox  
  
  use the busybox binary (toybox segmentation fault):
  www.busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl  


this would free up storage space by deleting some unimportant cache files only. this way it will neither harm the device nor create vulnerability for exploits  

this emergency-update.zip can be applied via the recovery menu's "Apply update from SD card"  

after this you should be able to boot at least once and get the availability to immediately enable airplane mode (prevents data usage), usb-debugging (for adb uninstall in case system_server crashes) and backup/clear your Internal Storage via MTP USB (or adb)