A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad

Overview

quick_breakpad

A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad

Use breakpad for quick_breakpad_example

$CLI_BREAKPAD is local clone of https://github.com/Sunbreak/cli-breakpad.trial

Android

  • run on macOS/Linux
# Device/emulator connected
$ android_abi=`adb shell getprop ro.product.cpu.abi`
$ pushd example
$ flutter run
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
I/quick_breakpad(28255): JNI_OnLoad
I quick_breakpad_example(28255): JNI_OnLoad
D quick_breakpad(28255): Dump path: /data/data/com.example.quick_breakpad_example/cache/54ecbb9d-cef5-4fa9-5b6869b2-198bc87e.dmp
$ popd
$ adb shell "run-as com.example.quick_breakpad_example sh -c 'cat /data/data/com.example.quick_breakpad_example/cache/54ecbb9d-cef5-4fa9-5b6869b2-198bc87e.dmp'" >| 54ecbb9d-cef5-4fa9-5b6869b2-198bc87e.dmp

Only C/C++ crash for now

$ $CLI_BREAKPAD/breakpad/linux/$(arch)/dump_syms example/build/app/intermediates/cmake/debug/obj/${android_abi}/libquick-breakpad-example.so > libquick-breakpad-example.so.sym
$ uuid=`awk 'FNR==1{print \$4}' libquick-breakpad-example.so.sym`
$ mkdir -p symbols/libquick-breakpad-example.so/$uuid/
$ mv ./libquick-breakpad-example.so.sym symbols/libquick-breakpad-example.so/$uuid/
$ $CLI_BREAKPAD/breakpad/linux/$(arch)/minidump_stackwalk 54ecbb9d-cef5-4fa9-5b6869b2-198bc87e.dmp symbols/ > libquick-breakpad-example.so.log
  • Show parsed Android log: head -n 20 libquick-breakpad-example.so.log

So the crash is at line 30 of quick_breakpad_example.cpp

image

iOS

  • run on macOS
  1. Get simulator UUID and run on it
$ flutter devices
1 connected device:
iPhone SE (2nd generation) (mobile) • C7E50B0A-D9AE-4073-9C3C-14DAF9D93329 • ios        • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
$ device=C7E50B0A-D9AE-4073-9C3C-14DAF9D93329
$ pushd example
$ flutter run -d $device
Running Xcode build...                                                  
 └─Compiling, linking and signing...                      2,162ms
Xcode build done.                                            6.2s
Lost connection to device.
$ popd
  1. Find application data and get dump file
$ data=`xcrun simctl get_app_container booted com.example.quickBreakpadExample data`
$ ls $data/Library/Caches/Breakpad
A1D2CF75-848E-42C4-8F5C-0406E8520647.dmp        Config-FsNxCZ
$ cp $data/Library/Caches/Breakpad/A1D2CF75-848E-42C4-8F5C-0406E8520647.dmp .
  1. Parse the dump file via symbols of Runner

Only C/C++/Objective-C crash for now

$ dsymutil example/build/ios/Debug-iphonesimulator/Runner.app/Runner -o Runner.dSYM
$ $CLI_BREAKPAD/breakpad/mac/dump_syms Runner.dSYM > Runner.sym
$ uuid=`awk 'FNR==1{print \$4}' Runner.sym`
$ mkdir -p symbols/Runner/$uuid/
$ mv ./Runner.sym symbols/Runner/$uuid/
$ $CLI_BREAKPAD/breakpad/mac/$(arch)/minidump_stackwalk A1D2CF75-848E-42C4-8F5C-0406E8520647.dmp symbols > Runner.log
  • Show parsed iOS log: head -n 20 Runner.log

So the crash is at line 11 of AppDelegate.m

image

Windows

https://github.com/woodemi/quick_breakpad/issues/4

macOS

https://github.com/woodemi/quick_breakpad/issues/5

Linux

  • run on Linux
$ pushd example
$ flutter run -d linux
Building Linux application...                                           
Dump path: /tmp/d4a1c6ac-2ad7-4301-c22e3c9b-0a4c5588.dmp
$ popd
$ cp /tmp/d4a1c6ac-2ad7-4301-c22e3c9b-0a4c5588.dmp .
  • parse the dump file
# flutterArch=x64 or arm64
$ $CLI_BREAKPAD/breakpad/linux/$(arch)/dump_syms build/linux/${flutterArch}/debug/bundle/quick_breakpad_example > quick_breakpad_example.sym
$ uuid=`awk 'FNR==1{print \$4}' quick_breakpad_example.sym`
$ mkdir -p symbols/quick_breakpad_example/$uuid/
$ mv ./quick_breakpad_example.sym symbols/quick_breakpad_example/$uuid/
$ $CLI_BREAKPAD/breakpad/linux/$(arch)/minidump_stackwalk d4a1c6ac-2ad7-4301-c22e3c9b-0a4c5588.dmp symbols/ > quick_breakpad_example.log
  • Show parsed Linux log: head -n 20 quick_breakpad_example.log

So the crash is at line 19 of my_application.cc

image

You might also like...

Flutter plugin for Flutter desktop(macOS/Linux/Windows) to change window size.

desktop_window Flutter plugin for Flutter desktop(macOS/Linux/Windows) to change window size. Usage import 'package:desktop_window/desktop_window.dart

Dec 2, 2022

A clean front-end plugin to Volumio, the Linux distribution for music playback. Volumio Touch Display Lite is written in Flutter and runs on flutter-pi.

A clean front-end plugin to Volumio, the Linux distribution for music playback. Volumio Touch Display Lite is written in Flutter and runs on flutter-pi.

EN | 中文 Touch Display Lite plugin for Volumio 3 Feng Zhou, 2021-12 Touch Display Lite is a clean and fast user interface for Volumio 3, the Linux dist

Jul 26, 2022

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.

A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.

Jan 6, 2023

Flutter plugin to store data behind biometric authentication (ie. fingerprint)

biometric_storage Encrypted file store, optionally secured by biometric lock for Android, iOS, MacOS and partial support for Linux, Windows and Web. M

Dec 28, 2022

A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux & Android.

A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux & Android.

flutter_media_metadata A Flutter plugin to read metadata of media files. A part of Harmonoid open source project 💜 Install Add in your pubspec.yaml.

Dec 2, 2022

This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut).

hotkey_manager This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut). hotkey_manager Platform Support Quick Star

Dec 21, 2022

This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc.

screen_retriever This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc. screen_retriever P

Dec 6, 2022

This plugin allows Flutter desktop apps to extract text from screen.

screen_text_extractor This plugin allows Flutter desktop apps to extract text from screen. screen_text_extractor Platform Support Quick Start Installa

Dec 21, 2022

This plugin allows Flutter desktop apps to defines system tray.

tray_manager This plugin allows Flutter desktop apps to defines system tray. tray_manager Platform Support Quick Start Installation ⚠️ Linux requireme

Dec 22, 2022
Comments
  • add setDumpPath for Windows.

    add setDumpPath for Windows.

    close #10

    Added a setDumpPath method by method_channel for Windows.

    Maybe that setDumpPath might too late for c++ world, since there still some logic (like plugin register) execute before the dart world. (But anyway, it seems to be enough for my usuage.

    opened by boyan01 1
  • [Feature Request] Custom the location of .dump file on Windows

    [Feature Request] Custom the location of .dump file on Windows

    Thanks for this great plugin.

    Is there a way to custom the location of .dump file ?

    On Windows, if we install the flutter app from Windows Store. the application all files will be installed to C:\Program Files\WindowsApps\your_app_name

    However, we don't seem to have write permissions for this directory. So I want to ask if this plugin can customize the write directory of the dump file on Windows.

    opened by boyan01 1
Owner
Woodemi Co., Ltd
Woodemi Co., Ltd
A cross-platform (Windows/macOS) scanner plugin for Flutter

quick_scanner A cross-platform (Windows/macOS) scanner plugin for Flutter Usage QuickScanner.startWatch(); var _scanners = await QuickScanner.getScan

Woodemi Co., Ltd 5 Jun 10, 2022
A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter

quick_usb A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter Usage List devices List devices with additional description Get device

Woodemi Co., Ltd 39 Oct 1, 2022
A Cross Platform Piano made with Flutter

flutter_piano A Crossplatform Midi Piano built with Flutter.dev This application runs on both iOS and Android. This runs a custom crossplatform midi s

Rody Davis 381 Jan 3, 2023
Photon is a cross-platform file-sharing application built using flutter.

Welcome to Photon ?? Photon is a cross-platform file-transfer application built using flutter. It uses http to transfer files between devices.You can

Abhilash Hegde 161 Jan 1, 2023
🎵 A cross-platform media playback library for C/C++ with good number of features (only Windows & Linux).

libwinmedia A cross-platform media playback library for C/C++ & Flutter with good number of features. Example A very simple example can be as follows.

Harmonoid 38 Nov 2, 2022
A cross-platform app ecosystem, bringing iMessage to Android, PC (Windows, Linux, & even macOS), and Web!

BlueBubbles Android App BlueBubbles is an open-source and cross-platform ecosystem of apps aimed to bring iMessage to Android, Windows, Linux, and mor

BlueBubbles 318 Jan 8, 2023
Yocto meta layer for recipes related to using Google Flutter Engine

meta-flutter Notice: Layer has moved to https://github.com/meta-flutter/meta-flutter. Redirection will be automatic in the next couple of weeks. Yocto

Joel Winarske 46 Dec 4, 2022
A fresh and modern Google Contacts manager that integrates with GitHub and Twitter.

Flokk A fresh and modern Google Contacts manager that integrates with GitHub and Twitter. Demo Builds Web: https://flokk.app Linux: https://snapcraft.

gskinner team 1.3k Jan 3, 2023
Flokk - A fresh and modern Google Contacts manager that integrates with GitHub and Twitter.

Flokk A fresh and modern Google Contacts manager that integrates with GitHub and Twitter. Demo Builds Web: https://flokk.app Linux: https://snapcraft.

gskinner team 1.1k Jan 3, 2022
A platform adaptive Flutter app for desktop, mobile and web.

Flutter Folio A demo app showcasing how Flutter can deliver a great multi-platform experience, targeting iOS, Android, MacOS, Windows, Linux, and web.

gskinner team 3.5k Jan 2, 2023