Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android adb pm disable component

Tags:

android

adb

I am trying to understand the use of the following command:

adb shell pm disable <PACKAGE_OR_COMPONENT>

For example: I have a test app with package name 'com.example.com.testapp' and it has an activity called 'TestActivity'.

I ran the following from my terminal :

./adb shell pm disable com.example.com.testapp/TestActivity

From the name of the command, I thought it would disable the activity from launching, but I can launch it fine via adb as follows:

./adb shell am start -n com.example.com.testapp/.TestActivity

So what does this command disable then ?

like image 213
Jake Avatar asked Jul 21 '26 05:07

Jake


1 Answers

I found the problem. It has nothing to do whether device is rooted or not.

I command had a missing dot. It should be :

./adb shell pm disable com.example.com.testapp/.TestActivity

Now if I try to launch the component, it's blocked (the app stops working).

like image 200
Jake Avatar answered Jul 23 '26 18:07

Jake



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!