Get current Activity name by adb shell

Here is the command:

adb shell "dumpsys window windows | grep -E 'mCurrentFocus'"

The output would be:

mCurrentFocus=Window{b6a99d1d0 u0 com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity}

My activity name is: LauncherActivity

create RainbowSpan effect

public class RainbowSpan extends CharacterStyle implements UpdateAppearance {
    private final int[] colors;

    public RainbowSpan(Context context) {
        colors = new int[]{
                Color.parseColor("#FF0033"),
                Color.parseColor("#FF8000"),
                Color.parseColor("#FFE600"),
                Color.parseColor("#1AB34D"),
                Color.parseColor("#1A66FF"),
                Color.parseColor("#801AB3")
        };
    }

    @Override
    public void updateDrawState(TextPaint paint) {
        paint.setStyle(Paint.Style.FILL);
        Shader shader = new LinearGradient(
                0, 0, 0,
                paint.getTextSize() * colors.length,
                colors, null,
                Shader.TileMode.MIRROR);
        Matrix matrix = new Matrix();
        matrix.setRotate(90);
        shader.setLocalMatrix(matrix);
        paint.setShader(shader);
    }
}

SQlite – enable log events and see it in logcat

Create .bat file with commands provided below:

adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell su 0 stop
adb shell su 0 start

After You execute app, You (in this case) emulator will reboot.

Now search in logcat something like this below:

/data/user/0/{APP_PACKAGE_NAME}/databases/{APP_DATABASE_NAME}

Resolutions and Densities – List

To change without root density and resolution on Your phone You can call in batch:

adb shell wm size {X}x{Y}
adb shell wm density {Z}

 

MODEL RESOLUTION DPI
Nexus 6 1440×2560 560
Samsung Galaxy S6 1440×2560 640
Samsung Galaxy Tab S2 8 1536×2048 320
Sony Xperia Tablet Z 1920×1200 240

To reset display call in batch:

adb shell wm size reset
adb shell wm density reset

I used information from application I’ve attachedĀ >>>HERE< <<