[Sony Xperia XA Ultra Guides, News, & Discussion] grogzero:
Warning up front: You can mess up your phone if you uninstall something that is needed for normal operation. Please do some research before you make any changes to your phone.

With Nougat out we can use ADB Shell on the XA Ultra to uninstall some unwanted system apps. In my case I don't really use the Sony stuff so I've uninstalled most of it. On a couple of apps that I do want installed but I don't want them running in the background I've used appops to prevent them from running in the background. I feel like my battery life has doubled since I did this. The amount of available memory has certainly increased.

I'm not making a full guide here since there are many out there already but here is the gist:

Put your phone in developer mode (tap on build number 7 times) and then enable USB debugging. Connect your phone to your computer with USB cable.

Use ADB on your computer to open a shell from the windows command prompt: ADB Shell. Tutorial on installing ADB here https://xdaforums.com/showthread.php?t=2266638

Within the shell you can list packages to see what you might want to uninstall with this command:

pm list packages -d

You'll get a long list of all the packages on your phone. I copied that list out of the shell into an editor and then added the uninstall commands below to certain ones to uninstall them. Here's what I've uninstalled with no ill effect (formatted for easy cut and paste):

pm uninstall -k --user 0 com.facebook.system

pm uninstall -k --user 0 com.sony.tvsideview.videoph

pm uninstall -k --user 0 com.sonyericsson.textinput.chinese

pm uninstall -k --user 0 com.sonyericsson.warrantytime

pm uninstall -k --user 0 com.sonymobile.enterprise.service

pm uninstall -k --user 0 com.sonymobile.gettoknowit

pm uninstall -k --user 0 com.sonymobile.moviecreator

pm uninstall -k --user 0 com.sonymobile.moviecreator.rmm

pm uninstall -k --user 0 com.sonymobile.music.googlelyricsplugin

pm uninstall -k --user 0 com.sonymobile.music.wikipediaplugin

pm uninstall -k --user 0 com.sonymobile.mx.android

pm uninstall -k --user 0 com.sonymobile.sketch

pm uninstall -k --user 0 com.sonymobile.support

pm uninstall -k --user 0 com.facebook.appmanager

pm uninstall -k --user 0 com.facebook.katana

pm uninstall -k --user 0 com.spotify.music

pm uninstall -k --user 0 com.sonymobile.getmore.client

pm uninstall -k --user 0 com.sony.tvsideview.phone

pm uninstall -k --user 0 com.sonyericsson.trackid

pm uninstall -k --user 0 com.amazon.mShop.android.shopping

pm uninstall -k --user 0 com.scee.psxandroid

pm uninstall -k --user 0 com.sonymobile.entrance

pm uninstall -k --user 0 com.s.antivirus

pm uninstall -k --user 0 com.sonyericsson.xhs

pm uninstall -k --user 0 com.sonymobile.xperialounge.services

pm uninstall -k --user 0 com.sonymobile.xperiaservices

pm uninstall -k --user 0 com.sonymobile.music.youtubekaraokeplugin

pm uninstall -k --user 0 com.sonymobile.tvout.wifidisplay

pm uninstall -k --user 0 com.sonymobile.music.youtubeplugin

pm uninstall -k --user 0 com.sonyericsson.trackid.res.overlay_305

For apps that I want to keep installed but I don't want them running in the background I used this format: "cmd appops set {package name] RUN_IN_BACKGROUND ignore"

For example:

cmd appops set net.zedge.android RUN_IN_BACKGROUND ignore

That was for Zedge. I still have Zedge installed on the phone in case I want to get some incredibly annoying ringtone to use during the third hour of our weekly hour long project review. I just don't want Zedge doing things on my phone when I'm not looking at it.

In developer options on your phone there's a running services section that is good to check for things that might need to be ignored using the above command. You can try killing something that is running here first to see if it messes with things you might want (like hangouts - I need mine running in the background).

I'm sure there were more packages I could have uninstalled but I was looking for mild gain with minimal risk.

I did this to the Xperia XA Ultra F3213 but I'm pretty sure it will be very similar on other models.