{"id":13695766,"url":"https://github.com/afaucogney/flipper-backstack","last_synced_at":"2025-05-03T13:33:17.689Z","repository":{"id":46569610,"uuid":"337987610","full_name":"afaucogney/flipper-backstack","owner":"afaucogney","description":"A Flipper-plugin to inspect the main Android object life-cycles in real-time.","archived":false,"fork":false,"pushed_at":"2021-10-24T07:24:06.000Z","size":903,"stargazers_count":10,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-12T23:36:11.160Z","etag":null,"topics":["activity","android","android-lifecycle","flipper","fragment","fragmentmanager","introspection","livedata","viewmodel"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afaucogney.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-11T09:51:11.000Z","updated_at":"2023-05-18T03:59:25.000Z","dependencies_parsed_at":"2022-09-23T01:42:00.542Z","dependency_job_id":null,"html_url":"https://github.com/afaucogney/flipper-backstack","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaucogney%2Fflipper-backstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaucogney%2Fflipper-backstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaucogney%2Fflipper-backstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaucogney%2Fflipper-backstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afaucogney","download_url":"https://codeload.github.com/afaucogney/flipper-backstack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252195926,"owners_count":21709737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activity","android","android-lifecycle","flipper","fragment","fragmentmanager","introspection","livedata","viewmodel"],"created_at":"2024-08-02T18:00:33.238Z","updated_at":"2025-05-03T13:33:17.053Z","avatar_url":"https://github.com/afaucogney.png","language":"Kotlin","readme":"# Android Object LifeCycle / BackStack Flipper Plugin \n\n## What you get ?\n\nThis library is an app introspection plugin for the [Flipper](https://github.com/facebook/flipper) tool. It does focus on Android Sdk mains objects and their life cycle inspection.\n\nIt enables to see the **big internal picture** of your running app in a side tool. Meaning that :\n\n - trough running the app as a user\n - you can keep an eye on internals as a developer\n - see the dynamic of objects evolution\n - without struggling with debugger\n\n## Status :\n\n - The plugin is **under development**\n - The plugin **name** is not sealed (ideas are welcome)\n - The **private Api** is not sealed at all (it will change in the future)\n - The **public Api** is simple : future breaking change will be easy to handle\n\n## Availability :\n\nYou can get the Android plugin with the Gradle dependency from Jitpack :\n\n- [![](https://jitpack.io/v/afaucogney/flipper-backstack.svg)](https://jitpack.io/#afaucogney/flipper-backstack)\n\nCurrent version is `5.0.2`\n\n## Vision\n\nThe idea behind this plugin is to enable understanding of what is happening during the usage of an Android Application by :\n\n - seeing logs about object life cycle changes\n - seeing internal Android object structure (limited to a set of specific architecture)\n - seeing objects stacks (FragmentManager BackStack, Jetpack Navigation Stack)\n - seeing current running objects\n - seeing objects destroyed (in Trash)\n\n## Show me a ScreenShot !\n\n![alt text](./screenshot/flipper_android_lifecyle_4.1.0.png)\n\n### What is in the Left part ?\n\nYou can see the app object structure :\n\n - Application\n - Activities\n - Fragments\n - ViewModels (with reflexion)\n - ViewModel members (LiveDatas) (with reflexion)\n - Jobs (not yet available)\n - Services (not yet available)\n - Trash (objects destroyed)\n - FragmentManager BackStack (legacy, only for activity)\n - JetPack Navigation BackStack\n \nThe object structure is viewed as a tree, where each instance of an object has is dedicated object category.\n \n - `HomeFragment` parent is `fragments`\n - `HomeFragment` children are running instances of `HomeFragment`\n    \n### What is in the Right part ?\n\nYou can see the object lifeCycle events for :\n  - activities\n  - fragments\n\nYou can filter those event categories :\n - created / destroyed\n - started / stopped\n - paused / resumed\n - attached / detached\n - view-created / view-destroyed\n - SaveInstanceState     \n\n## Installation\n\n### Step 1 : Add the JitPack repository to your build file\n\nAdd it in your root build.gradle at the end of repositories:\n\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n\n### Step 2 : Add the dependency\n\n\tdependencies {\n\t\tdebugImplementation 'com.github.afaucogney:flipper-backstack:-SNAPSHOT'\n\t}\n\t\n### Step 3 : Add Flipper to your app\n\nFollow the [Getting Started](https://fbflipper.com/docs/getting-started/android-native) section of the Flipper documentation\n\n### Step 4 : Add the Android-Object-LifeCycle plugin to Flipper\n\nIn your application, register the plugin the Flipper configuration.\n\n    val client: FlipperClient = AndroidFlipperClient.getInstance(this)\n    with(client) {\n        addPlugin(\n            InspectorFlipperPlugin(\n                this@App,\n                DescriptorMapping.withDefaults()\n            )\n        )\n        ... \n        addPlugin(BackStackFlipperPlugin(this@App))\n        start()\n    }\t\n\t\nBe careful, to not embed this library in production !\n\n### Step 5 : Add the Android-Object-LifeCycle plugin to Flipper-Desktop\n\nInstall the plgin in Flipper, it is called `lifecycle` [Npm page](https://www.npmjs.com/package/flipper-plugin-lifecycle)\n\n## What can you achieve with the plugin ?\n \n - identify runtime object instances and structure\n - identify leaks (remaining objects)\n - identify bug instantiations (recreation Vs preservation)\n - understand architecture in a breeze\n - see object instantiation in real time\n - lifeCycle issues\n - backStack issues\n\n## Consideration\n\n- This plugin (as Flipper) must not be shipped in Production\n- This plugin may doing lot of work, so please consider disabling it if you are not using it. I have not yet done measurement to evalute it resource requirement. But from the `5.0.0` version\n - It should run on Background tread thank to Rx\n - However, data structure of the app is kept in memory, so it may be a problem for some App or some low memory devices\n- The Plugin uses Reflection for accessing privage properties or functions\n\n## TODO\n\n- [ ] Be able to filter object in structure\n - [ ] Impact event filtering from object\n- [ ] Evaluate saving data in db / shareprefs\n- [ ] Handle clean versioning / release\n- [ ] Generate docs\n- [ ] Impl Jobs support\n- [ ] Impl Services support\n- [ ] See bundle / saveinstance state\n- [ ] See App lifecycle\n- [ ] Evaluated StateFlow support (on going PR)\n- [ ] Imp BlackStack for ChildFragmentManager\n- [ ] Highligh duplicate object in the tree if you click on it (see link between framgnet in stack...)\n\n## ISSUES\n\n- [ ] At first start, the tree is not updated ! You need to change screen to update the plugin.\n\n \n\n \n ","funding_links":[],"categories":["Android"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaucogney%2Fflipper-backstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafaucogney%2Fflipper-backstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaucogney%2Fflipper-backstack/lists"}