3

Android Developer Options that you probably forgot

 2 years ago
source link: https://medium.com/@DoesitPew/android-developer-options-that-you-probably-forgot-431e31d4c5fc
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Android Developer Options that you probably forgot

Sometimes, I think that we “Old Android Folk” forget to share and re-share the old magic with newer developers or just forget the old ways ourselves.

Now we are all well past the ANT and Eclipse days, but there are tools that have remained highly functional or grown to be more useful over time. Or, in the light of new tech like ComposeUI, have gained new functionality not easily achievable any way else. 🤫

Let’s talk about… Developer Options

Beware, this article is a re-hash of existing content (see above) in a practical sense for practical devs that actually shows & explains. Not all options will show on all devices.

You are now a Developer…

But did you ever take a look at all the tools in there? 👀

Standard Debugging Tools

Standard things everyone uses almost every day or should know

Bug report shortcut — For Bug reports …a shortcut

Verbose vendor logging — (Vendor devices only) More complete logging in Logcat than would happen normally and can be useful for vendor interactions, fixing a vendor bug, or debugging an integration (*coughs in Samsung*)

Enable view attribute inspection — See View Attributes in the Layout Inspector in Android Studio

Select debug app + Wait for debugger — App won’t start unless the debugger is attached in Android Studio, so you can debug things at startup without a crazy logcat to parse and false warnings.

Verify apps over USB + Verify bytecode of debuggable apps — Generally smart to make sure you don’t load a dodgy app or general malware by accident (usually online)

Logger buffer sizes — Enable longer or shorter logcats (easier to parse longer ones and capture more events)

Feature Flags — Enable features normally hidden for most users, usually more useful on pre-release or experimental release builds with features to be enabled (features like PiP and onscreen notifications were originally tested this way)

Enable GPU debug layers — Enables Vulkcan validation layers for error checking (Mostly for mobile game developers not using OpenGL, though some made-for-Android libs use it too for 3D rendering)

Show refresh rate — It's the refresh rate of the device and screen currently in use (120FPS!) 😎

Debug and Record Touch Targets and Gestures

These two tools are great for recording your work, displaying functionality to others, and debugging things like touch targets and gestures.

Show taps — Small round icon onscreen for where the device believes you are touching (or multiples)

Pointer location — Shows on screen the whole trace of your finger(s) while in a continuous motion along with coordinates (up top)

Show Taps on screen setting and Show Pointer Location on screen
Visible Touch for targets and gestures

UI Inspection and Overdraw

Set of tools to be used all the time by any app developer with a front end.

Show surface updates — Flashes when there are updates to the UI(usually pink)

Show layout bounds*** — SUPER USEFUL!!! Shows the bounds of each piece as drawn on screen and how they are connected (great for ConstraintLayout), but this has GREAT helpful bits for Compose UI too! For Compose, you can see if you left any remnants or are actually drawing elsewhere then moving. For a11y, you know exactly where your bounds are and how flat your compositions are to better your speed and UI/UX.

Debug GPU overdraw — Shows you on-screen where and how you are overdrawing in the space. This is bad for rendering in several ways, but can also indicate why a user interaction isn’t working properly (redraw). Standard color = no overdraw. Blue = 1 layer overdrawn. Green = 2 layer overdraw. Pink = 3 layers overdraw. Red = 4+ layers overdrawn. (This one gets weird with Compose because of how it works with the draw cycles, so take that into account on ComposeUI.)

Show view updates — Flashes when there are draw updates (multi-color)

Show hardware layers updates — Flashes when there are updates to the hardware layers (green)

UI Inspection Tools

Visual Performance

Know if you are meeting UI performance standards in real-time and what is causing lag.

Strict mode enabled — Flashes on screen when something is is holding the main thread too long

Profile HWUI Rendering — “On Screen as Bars” presenting a visual of the GPU Rendering graph. Each bar is a “frame” on screen and the height indicates how long it took to render. The Green Bar represents hitting a 60FPS target which means no visible jitter to the user (16ms), smooth. The red bar represents 30FPS and beyond it is the “Danger Zone” where it is noticeable by everyone. If the bar fills the screen, the UI skipped those frames as far as the user is concerned. Click here to go more in-depth on what each piece means.

Visual Profiling Performance

Testing device crashes and weirdness

Emulate systems with low ram or slow processors and certain scenarios that are otherwise hard to replicate. Make your apps resilient and finally track down that one bug! 🐛

Don’t keep activities — kill activities as soon as the next activity is started. GREAT for testing back-stack and returning apps from 3rd party integrations where data is lost or computation entirely gone that is needed.

Background process limit — Emulate older devices and aggressive runtimes/schedulers that limit what can be run at any given time (can also be a performance boon for older devices). Track down what happens when your async code fails that really should be synchronized tasks.

Force activities to be resizable — Know how your app looks and works when resized for different devices like small phones, tables, convertibles and CHROMEBOOKS.

Force desktop mode — See how your apps work on desktops like Chromebooks and Tablets when hooked up to external displays like TVs.

Test processes along with activity and data loss

Recording Traces in the wild! 🏕

Did you know that you can record a system trace on-device with only the things you care about RIGHT when you happen to see odd behavior, but don’t happen to have your computer handy?

Record trace — Starts and ends the system trace

Trace debuggable applications — Traces any debuggable applications currently installed

Categories — All of the different selectable system processes to trace

Please share any tools that matter to you and message me (my DMs are open) so that we can continue to add sections depending on what you do as an Android developer (IoT, Game, Flutter, etc). 👋


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK