I want to watch the layout of App without boring tap and tap.
I tried adb shell setprop debug.layout true
but didn't work unless reboot or open setting.
This may caused by setting haven't update.
I tried to writing a little App with code SystemProperties.set("debug.layout", "true")
, no use too.
Maybe the app's authority…
Sorry for my poor English and appreciation for help :p
On Android, we have an option called Show layout bounds , which allows us to see bounding areas of your views displayed in vibrant blue and purple.
This works for me:
adb shell setprop debug.layout true
adb shell service call activity 1599295570
After we have enabled Show layout bounds using adb shell setprop debug.layout true
, we have to poke the SystemProperties to see the changes
as Show layout bounds QS Tiles does:
@Override
public void onClick() {
setIsEnabled(getQsTile().getState() == Tile.STATE_INACTIVE);
new DevelopmentSettings.SystemPropPoker().execute(); // Settings app magic
refresh();
}
Here's the original method from AOSP source:
public static class SystemPropPoker extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
String[] services = ServiceManager.listServices();
for (String service : services) {
IBinder obj = ServiceManager.checkService(service);
if (obj != null) {
Parcel data = Parcel.obtain();
try {
obj.transact(IBinder.SYSPROPS_TRANSACTION, data, null, 0);
} catch (RemoteException e) {
} catch (Exception e) {
Log.i(TAG, "Someone wrote a bad service '" + service
+ "' that doesn't like to be poked: " + e);
}
data.recycle();
}
}
return null;
}
}
The number 1599295570
is called SYSPROPS_TRANSACTION
Reference: https://github.com/dhelleberg/android-scripts/blob/master/src/devtools.groovy
UPDATED: I created this app to add many developer toggle to the quick settings for Android 7.0+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With