{"id":21437524,"url":"https://github.com/appspector/flutter-plugin","last_synced_at":"2025-07-14T15:30:52.908Z","repository":{"id":37580249,"uuid":"164623705","full_name":"appspector/flutter-plugin","owner":"appspector","description":"Flutter plugin for AppSpector SDK. With AppSpector you can remotely debug your app running in the same room or on another continent in real-time. https://pub.dev/packages/appspector","archived":false,"fork":false,"pushed_at":"2023-07-06T17:07:54.000Z","size":3730,"stargazers_count":61,"open_issues_count":9,"forks_count":10,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2023-08-20T21:26:22.479Z","etag":null,"topics":["android","dart","debugging","flutter","ios","logger"],"latest_commit_sha":null,"homepage":"https://appspector.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appspector.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T10:24:24.000Z","updated_at":"2023-03-29T14:03:34.000Z","dependencies_parsed_at":"2022-09-13T08:12:28.391Z","dependency_job_id":null,"html_url":"https://github.com/appspector/flutter-plugin","commit_stats":null,"previous_names":[],"tags_count":17,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appspector%2Fflutter-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appspector%2Fflutter-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appspector%2Fflutter-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appspector%2Fflutter-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appspector","download_url":"https://codeload.github.com/appspector/flutter-plugin/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225983144,"owners_count":17555095,"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":["android","dart","debugging","flutter","ios","logger"],"created_at":"2024-11-23T00:20:52.958Z","updated_at":"2024-11-23T00:20:53.462Z","avatar_url":"https://github.com/appspector.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub release](https://img.shields.io/github/release/appspector/flutter-plugin.svg)](https://github.com/appspector/flutter-plugin)\n# ![AppSpector](https://github.com/appspector/flutter-plugin/raw/master/github-cover.png)\n\nA plugin that integrate [AppSpector](https://appspector.com/?utm_source=flutter_readme) to your Flutter project.\n\nWith AppSpector you can remotely debug your app running in the same room or on another continent. \nYou can measure app performance, view database content, logs, network requests and many more in realtime. \nThis is the instrument that you've been looking for. Don't limit yourself only to simple logs. \nDebugging doesn't have to be painful!\n\n\u003cimg src=\"https://github.com/appspector/appspector-flutter/raw/master/static/appspector_demo.gif\" width=\"700px\" alt=\"AppSpector demonstration\" /\u003e\n\n* [Installation](#installation)\n  * [Add AppSpector plugin to pubspec.yaml](#add-appspector-plugin-to-pubspecyaml)\n  * [Initialize AppSpector plugin](#initialize-appspector-plugin)\n  * [Build and Run](#build-and-run)\n  * [Getting session URL](#getting-session-url)\n  * [Correct SQLite setup for the SDK](#correct-sqlite-setup-for-the-sdk)\n* [Configure](#configure)\n  * [Start/Stop data collection](#startstop-data-collection)\n  * [Custom device name](#custom-device-name)\n  * [Getting session URL](#getting-session-url)\n  * [Correct SQLite setup for the SDK](#correct-sqlite-setup-for-the-sdk)\n* [Features](#features)\n  * [SQLite monitor](#sqlite-monitor)\n  * [HTTP monitor](#http-monitor)\n  * [Logs monitor](#logs-monitor)\n    * [Logger](#logger)\n  * [Location monitor](#location-monitor)\n  * [Screenshot monitor](#screenshot-monitor)\n  * [SharedPreference/UserDefaults monitor](#sharedpreferenceuserdefaults-monitor)\n  * [Performance monitor](#performance-monitor)\n  * [Environment monitor](#environment-monitor)\n  * [Notification Center monitor (only for iOS)](#notification-center-monitor-only-for-ios)\n  * [File System Monitor](#file-system-monitor)\n* [Feedback](#feedback)\n\n\n# Installation\n\nBefore using AppSpector SDK in your Flutter app you have to register it on ([https://app.appspector.com](https://app.appspector.com?utm_source=android_readme)) via web or [desktop app](https://appspector.com/download/?utm_source=android_readme).\nTo use SDK on both platforms (iOS and Android) you have to register two separate apps for different platforms.\nAPI keys required for the SDK initialisation will be available on the Apps settings pages\n\n## Add AppSpector plugin to pubspec.yaml\n```yaml\ndependencies\n  appspector: '0.10.0'\n```\n\n## Initialize AppSpector plugin\n```dart\nimport 'package:appspector/appspector.dart';\n\nvoid main() {\n  WidgetsFlutterBinding.ensureInitialized();\n  runAppSpector();\n  runApp(MyApp());\n}\n\nvoid runAppSpector() {\n  final config = Config()\n    ..iosApiKey = \"Your iOS API_KEY\"\n    ..androidApiKey = \"Your Android API_KEY\";\n  \n  // If you don't want to start all monitors you can specify a list of necessary ones\n  config.monitors = [Monitors.http, Monitors.logs, Monitors.screenshot];\n  \n  AppSpectorPlugin.run(config);\n}\n```\n\n## Build and Run\nBuild your project and see everything work! When your app is up and running you can go to [https://app.appspector.com](https://app.appspector.com/?utm_source=flutter_readme) and connect to your application session.\n\n\n# Configure\n\n## Start/Stop data collection\n\nAfter calling the `run` method the SDKs start data collection and\ndata transferring to the web service. From that point you can see\nyour session in the AppSpector client.\n\nSince plugin initialization should locate in the main function we provide\nmethods to help you control AppSpector state by calling `stop()` and `start()` methods.\n\n**You are able to use these methods only after AppSpector was initialized.**\n\nThe `stop()` tells AppSpector to disable all data collection and close current session.\n\n```dart\nawait AppSpectorPlugin.shared().stop();\n```\n\nThe `start()` starts it again using config you provided at initialization.\n\n```dart\nawait AppSpectorPlugin.shared().start();\n```\n\n**As the result new session will be created and all activity between\n`stop()` and `start()` calls will not be tracked.**\n\nTo check AppSpector state you can use `isStarted()` method.\n\n```dart\nawait AppSpectorPlugin.shared().isStarted();\n```\n\n## Custom device name\n\nYou can assign a custom name to your device to easily find needed sessions\nin the sessions list. To do this you should add the desired name as a value\nfor `MetadataKeys.deviceName` key to the `metadata` dictionary:\n\n```dart\nvoid runAppSpector() {\n  var config = new Config()\n    ..iosApiKey = \"Your iOS API_KEY\"\n    ..androidApiKey = \"Your Android API_KEY\"\n    ..metadata = {MetadataKeys.deviceName: \"CustomName\"};\n  \n  AppSpectorPlugin.run(config);\n}\n```\n\nAlso, the plugin allows managing the device name during application lifetime using\n\nthe `setMetadataValue` method to change device name\n\n```dart\nAppSpectorPlugin.shared().setMetadataValue(MetadataKeys.deviceName, \"New Device Name\");\n```\n\nor the `removeMetadataValue` to remove your custom device name\n\n```dart\nAppSpectorPlugin.shared().removeMetadataValue(MetadataKeys.deviceName);\n```\n\n## Getting session URL\n\nSometimes you may need to get URL pointing to current session from code.\nSay you want link crash in your crash reporter with it, write it to logs or\ndisplay in your debug UI. To get this URL you have to add a session start callback:\n\n```dart\nAppSpectorPlugin.shared()?.sessionUrlListener = (sessionUrl) =\u003e {\n// Save url for future use...\n};\n```\n\n\n## Correct SQLite setup for the SDK\n\nThe SQLite monitor on Android demands that any DB files are located at the `database` folder.\nSo, if you're using [sqflite](https://pub.dev/packages/sqflite) the code for opening db will be looks like that:\n\n```dart\nvar dbPath = await getDatabasesPath() + \"/my_database_name\";\nvar db = await openDatabase(dbPath, version: 1, onCreate: _onCreate);\n```\n\nThe `getDatabasesPath()` method is imported from `package:sqflite/sqflite.dart`.\n\n# Features\n\nAppSpector provides many monitors that are can be different for both platforms.\n\n### SQLite monitor\nProvides browser for sqlite databases found in your app. Allows to track all queries, shows DB scheme and data in DB. You can issue custom SQL query on any DB and see results in browser immediately.\n\n\u003cimg src=\"https://storage.googleapis.com/appspector.com/images/monitor-screenshots/sqlite-monitor@2x.png\" width=\"700px\" alt=\"SQLite monitor\" /\u003e\n\n#### HTTP monitor\nShows all HTTP traffic in your app. You can examine any request, see request/response headers and body.\nWe provide XML and JSON highliting for request/responses with formatting and folding options so even huge responses are easy to look through.\n\n\u003cimg src=\"https://storage.googleapis.com/appspector.com/images/monitor-screenshots/network-monitor@2x.png\" width=\"700px\" alt=\"HTTP monitor\" /\u003e\n\n### Logs monitor\nDisplays all logs generated by your app.\n\n#### Logger\nAppSpector Logger allows you to collect log message only into AppSpector\nservice. It is useful when you log some internal data witch can be leaked\nthrough Android Logcat or similar tool for iOS.\n\nIt has a very simple API to use:\n\n```dart\nLogger.d(\"MyTAG\", \"It won't be printed to the app console\");\n```\n\n**Don't forget to import it** from `package:appspector/appspector.dart`.\n\n\u003cimg src=\"https://storage.googleapis.com/appspector.com/images/monitor-screenshots/logs-monitor@2x.png\" width=\"700px\" alt=\"Logs\" /\u003e\n\n### Location monitor\nMost of the apps are location-aware. Testing it requires changing locations yourself. In this case, location mocking is a real time saver. Just point to the location on the map and your app will change its geodata right away.\n\n\u003cimg src=\"https://storage.googleapis.com/appspector.com/images/monitor-screenshots/location-monitor@2x.png\" width=\"700px\" alt=\"Location\" /\u003e\n\n### Screenshot monitor\nSimply captures screenshot from the device.\n\n### SharedPreference/UserDefaults monitor\nProvides browser and editor for SharedPreferences/UserDefaults.\n\n### Performance monitor\nDisplays real-time graphs of the CPU / Memory/ Network / Disk / Battery usage.\n\n### Environment monitor\nGathers all of the environment variables and arguments in one place, info.plist, cli arguments and much more.\n\n### Notification Center monitor (only for iOS)\nTracks all posted notifications and subscriptions. You can examine notification user info, sender/reciever objects, etc.\nAnd naturally you can post notifications to your app from the frontend.\n\n### File System Monitor\nProvides access to the application internal storage on Android and sandbox and bundle on iOS.\nUsing this monitor you're able to download, remove or upload files, create directories and just walk around your app FS.\n\nFor mode details, you can visit [Android SDK](https://github.com/appspector/android-sdk/) and [iOS SDK](https://github.com/appspector/ios-sdk) pages.\n\n\n# Feedback\nLet us know what do you think or what would you like to be improved: [info@appspector.com](mailto:info@appspector.com).\n\n[Join our slack to discuss setup process and features](https://slack.appspector.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappspector%2Fflutter-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappspector%2Fflutter-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappspector%2Fflutter-plugin/lists"}