Raspberry Pi4 ~ ADB ~ wifi [Uninstall some google apps]

Hi I’m just getting my head around using ADB on a Raspberry pi (Buster OS)

It has been many years since I used ADB on a Windows to Samsung.

The phone does not need to be rooted or OEM unlocked
It does require enabling Developer options > USB debugging

I downloaded the adb files to the Rasp-pi via terminal commands

  • sudo apt install android-tools-adb android-tools-adbd android-tools-fastboot android-tools-fsutils android-tools-mkbootimg

Then

  • Connect cable Rasp- pi USBA to FP3 USBC.

Using Rasp-pi terminal

  • Get the device ID via terminal by typing adb devices
  • To connect to phone type adb –s <device_ID> tcpip 5555.
    If there is only one device adb tcpip 5555 will do
    The phone should ask to confirm the connection

For WIFI

  • Get IP address from Settings >About phone > Ip address
    You can now remove the cable.
  • Back to terminal and type adb connect <IP Address>:5555
    for example adb connect 192.168.###.###:5555

You should now have wifi connection.

To do the above I followed [android-adb-over-wifi]

2 Likes

First use the terminal on your computer, in this case a Rasp-pi to log in to the phone’s OS via the command:-

adb shell
Logging in to the phone the terminal outputs
FP3:/ $

Now the commands to remove Youtube
pm uninstall --user 0 com.google.android.youtube
pm uninstall --user 0 com.google.android.apps.youtube.music

To get the names of the packages to uninstall etc. use
pm list packages

pm invoke the packet manager
uninstall command to pm
--user 0 That’s two minus signs and a space before the zero. Zero is the default or only user on the phone.

The rest is the name of the package. Should you want to reinstall some packages you will have lost all related data held in cache unless you add a parameter between uninstall and user i.e.

-k Do not delete cache

pm uninstall -k --user 0 com.google.android.apps.wellbeing

So on to debloat and de google where possible.

I am listing the uninstalls on the next post

Reinstalling apps

As well as those mentioned in the previous post I have uninstalled the following:-

com.google.android.gm :: Gmail
com.google.android.googlequicksearchbox
com.google.android.apps.maps
com.google.android.calendar
com.google.android.apps.photos
com.google.android.feedback
com.google.android.gms.location.history
com.google.android.apps.docs :: Google Drive
com.google.android.videos :: Movies and TV
com.android.chrome
android.autoinstalls.config.vodafone.fairphone3

com.fairphone.myfairphone

Reinstalling apps

Packages are not actually deleted from the Google Services but are removed from the user hence the parameter user: 0

Once in the shell terminal type
pm install-existing com.google.android.apps.youtube.music

which will output
Package com.google.android.apps.youtube.music installed for user: 0

I had to reinstate the outube.music app as I noticed file manager would not open audio files and I couldn’t choose another app ??

In order to install Signal, as a possible alternative to WhatsApp I came across the problem that on entering my tel. no. I received a message saying Google Play services is unavailable

I found this help:

There is a workaround
Disabling google via adb is not sufficient, because it still is linked somewhere in the system You need to remove/disable it this way too:

`adb shell pm disable-user --user 0 com.google.android.gms`

After this there was a warning that Google Play services was disabled but the process worked fine.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.

Ok my second stint is brought about by a coding mishap in the A11β 8901.4.A.0016.1 which stops OTA updates. So adb will be used to side-load a fix.

So just tested out my access via the Raspberry Pi in advance and all is well.

Just discovered the option to list all the packages on the phone.

The earlier ‘adb shell’ command was pm list packages
it is now cmd package list packages

Both versions currently work on my setup.

1 Like

Just adding a note as I am going to remove Google Play Store

pm uninstall --user 0 com.android.vending

It still shows under Settings > Apps and notifications > SEE ALL ## APPS but notes it is
Uninstalled for this user

For a more general guide for using adb to ‘delete|uninstall’ apps for the current user