Convert Figma logo to code with AI

facebook logoflipper

A desktop debugging platform for mobile developers.

13,333
953
13,333
497

Top Related Projects

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

162,288

Visual Studio Code

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.

The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools

A framework for building native applications using React

8,292

Library for cross-platform app development.

Quick Overview

Flipper is an extensible mobile app debugger for iOS, Android, and React Native apps. It provides a desktop interface for inspecting, manipulating, and debugging mobile applications during development, offering features like network inspection, layout inspection, and crash reporting.

Pros

  • Cross-platform support for iOS, Android, and React Native
  • Extensible plugin architecture allowing developers to create custom debugging tools
  • Rich set of built-in plugins for common debugging tasks
  • Real-time updates and interaction with running apps

Cons

  • Requires integration into the app, which may increase app size
  • Some features may have performance impact when enabled in production builds
  • Learning curve for creating custom plugins
  • Limited support for certain app architectures or frameworks

Code Examples

  1. Initializing Flipper in an Android app:
class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        SoLoader.init(this, false)
        if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) {
            val client = AndroidFlipperClient.getInstance(this)
            client.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()))
            client.start()
        }
    }
}
  1. Adding a custom plugin to Flipper:
class MyCustomPlugin : FlipperPlugin {
    override fun getId(): String = "MyCustomPlugin"

    override fun onConnect(connection: FlipperConnection) {
        connection.receive("myEvent") { params ->
            // Handle received event
        }
    }

    override fun onDisconnect() {
        // Clean up resources
    }

    override fun runInBackground(): Boolean = false
}
  1. Sending data to Flipper from your app:
val flipperClient = AndroidFlipperClient.getInstance(context)
val plugin = flipperClient.getPlugin<MyCustomPlugin>("MyCustomPlugin")
plugin?.send("myEvent", FlipperObject.Builder()
    .put("key", "value")
    .build())

Getting Started

  1. Add Flipper dependencies to your app's build.gradle:
dependencies {
    debugImplementation 'com.facebook.flipper:flipper:0.125.0'
    debugImplementation 'com.facebook.soloader:soloader:0.10.3'
    releaseImplementation 'com.facebook.flipper:flipper-noop:0.125.0'
}
  1. Initialize Flipper in your Application class (see first code example above).

  2. Download and install the Flipper desktop app from the official website.

  3. Run your app in debug mode and connect it to Flipper using the desktop application.

Competitor Comparisons

113,668

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Pros of Electron

  • Cross-platform desktop app development using web technologies
  • Large and active community with extensive documentation and resources
  • Seamless integration with Node.js for native functionality

Cons of Electron

  • Larger application size due to bundled Chromium runtime
  • Higher memory usage compared to native applications
  • Potential security concerns due to full system access

Code Comparison

Electron (main process):

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

app.whenReady().then(createWindow)

Flipper (plugin):

import { Plugin, Device } from 'flipper-plugin';

class MyPlugin extends Plugin<> {
  static title = 'My Plugin';
  
  init() {
    // Plugin initialization
  }
}

Key Differences

  • Electron focuses on desktop app development, while Flipper is a mobile app debugging platform
  • Electron uses web technologies for UI, whereas Flipper uses React for its plugin interface
  • Flipper is specifically designed for mobile app debugging, while Electron is a general-purpose framework

Use Cases

  • Electron: Building cross-platform desktop applications
  • Flipper: Debugging and inspecting mobile applications during development
162,288

Visual Studio Code

Pros of VS Code

  • Broader application as a general-purpose code editor
  • Extensive ecosystem of extensions and themes
  • Larger community and more frequent updates

Cons of VS Code

  • Heavier resource usage, especially for large projects
  • Steeper learning curve for new users
  • Less specialized for mobile app debugging

Code Comparison

VS Code (settings.json):

{
  "editor.fontSize": 14,
  "editor.tabSize": 2,
  "editor.wordWrap": "on",
  "files.autoSave": "afterDelay"
}

Flipper (package.json):

{
  "name": "flipper",
  "version": "0.127.0",
  "description": "Mobile app debugger",
  "main": "index.js",
  "license": "MIT"
}

VS Code is a versatile code editor suitable for various programming languages and tasks, while Flipper focuses on mobile app debugging. VS Code offers a rich extension ecosystem, making it highly customizable, but this can lead to increased resource usage. Flipper, being more specialized, provides a streamlined experience for mobile developers but may lack some general-purpose features found in VS Code. The code comparison shows VS Code's user settings, highlighting its customizability, while Flipper's package.json demonstrates its focus on mobile app debugging.

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.

Pros of React DevTools

  • Specifically designed for React applications, offering deep integration and insights
  • Lightweight browser extension, easy to install and use for web development
  • Provides component hierarchy visualization and props/state inspection

Cons of React DevTools

  • Limited to React applications, not suitable for other frameworks or native apps
  • Lacks advanced network monitoring and device logs features
  • No built-in plugin system for extending functionality

Code Comparison

React DevTools:

const MyComponent = () => {
  const [count, setCount] = useState(0);
  return <div onClick={() => setCount(count + 1)}>{count}</div>;
};

Flipper:

import {Plugin, Client} from 'flipper-plugin';

class MyPlugin extends Plugin {
  static title = 'My Plugin';
  client: Client;
  
  init() {
    this.client.addLogListener(this.onLog);
  }
}

Key Differences

  • React DevTools focuses on React component debugging, while Flipper is a more general-purpose mobile app debugging platform
  • Flipper supports native mobile apps and has a plugin system for extensibility
  • React DevTools is primarily for web development, while Flipper targets mobile app development

Use Cases

  • Choose React DevTools for web-based React application debugging
  • Opt for Flipper when working on mobile apps or requiring more extensive debugging features

The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools

Pros of React Native Debugger

  • Specifically designed for React Native, offering a more tailored debugging experience
  • Integrates React DevTools, Redux DevTools, and Chrome DevTools in a single interface
  • Lightweight and easy to set up, with no additional configuration required in most cases

Cons of React Native Debugger

  • Limited to React Native projects, unlike Flipper's broader support for mobile development
  • Lacks some advanced features and plugins available in Flipper
  • May have less frequent updates and community support compared to Flipper

Code Comparison

React Native Debugger setup:

// No additional code required in most cases
// Just run the debugger and connect your app

Flipper setup:

import { addPlugin } from 'react-native-flipper';
import { NetworkPlugin } from 'flipper-plugin-network';

addPlugin(new NetworkPlugin());

While React Native Debugger often requires no additional code, Flipper may need plugin integration for specific features.

React Native Debugger is a specialized tool for React Native development, offering a streamlined experience with integrated DevTools. Flipper, on the other hand, provides a more extensible platform for mobile development in general, with a wider range of plugins and features. The choice between the two depends on the specific needs of the project and the developer's preferences.

A framework for building native applications using React

Pros of React Native

  • Larger community and ecosystem, with more third-party libraries and resources
  • Cross-platform development for both iOS and Android from a single codebase
  • Faster development cycles with hot reloading and live updates

Cons of React Native

  • Performance can be slower than native apps, especially for complex UI
  • Debugging can be more challenging due to the JavaScript bridge
  • Requires additional effort to achieve a truly native look and feel

Code Comparison

React Native:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

const App = () => (
  <View style={styles.container}>
    <Text>Hello, React Native!</Text>
  </View>
);

Flipper:

#include <flipper/flipper.h>

int main() {
    FlipperClient* client = FlipperClient::getInstance();
    client->addPlugin(std::make_shared<ExamplePlugin>());
    client->start();
}

Key Differences

  • React Native is focused on mobile app development, while Flipper is a debugging platform
  • React Native uses JavaScript and React, whereas Flipper primarily uses C++ for its core functionality
  • React Native has a more extensive user base and community support compared to Flipper
  • Flipper is specifically designed for debugging and inspecting mobile apps, while React Native is for building them
8,292

Library for cross-platform app development.

Pros of ReactXP

  • Cross-platform development for web, iOS, Android, and Windows
  • Consistent API across platforms, reducing code duplication
  • Strong TypeScript support for improved type safety

Cons of ReactXP

  • Less active development and community compared to Flipper
  • Limited to React-based applications
  • Steeper learning curve for developers new to React Native

Code Comparison

ReactXP:

import RX = require('reactxp');

class MyComponent extends RX.Component<{}, {}> {
    render() {
        return <RX.View>
            <RX.Text>Hello, world!</RX.Text>
        </RX.View>;
    }
}

Flipper:

import React from 'react';
import {PluginClient, usePlugin, createState, useValue} from 'flipper-plugin';

const plugin = (client: PluginClient<>) => {
  const count = createState(0, {persist: 'count'});
  return {count};
};

Key Differences

  • ReactXP focuses on cross-platform UI development, while Flipper is a mobile app debugging platform
  • ReactXP uses a unified API for multiple platforms, whereas Flipper is specifically designed for mobile app debugging
  • Flipper has a more active community and frequent updates, while ReactXP has slower development cycles
  • ReactXP requires knowledge of React and React Native, while Flipper is more accessible to developers familiar with mobile app development in general

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

logo

Flipper

Android Maven Badge iOS


Important Announcement

Flipper is moving away from its Electron distribution to an in-Browser experience.

How does this affect me?

Functionality hasn't changed. The UI remains unchanged. Flipper will run in your default browser instead of a standalone application. If you build from source, Flipper will open in the browser instead of a standalone app. We also provide a MacOS app for the Flipper runtime which can be run and will also open Flipper in the browser.

The last Electron release is v0.239.0. As such, future releases will not include Electron artifacts.

React Native support

If you are debugging React Native applications, v0.239.0 will be the last release with support for it due to technical limitations for React Dev Tools and Hermes Debugger plugins. As such, please refer to that release when debugging React Native applications.

New, dedicated debug tooling for React Native is currently being developed at Meta. In the mean time we recommend this blog post with guidance on how to get the capibilities of Flipper through several alternatives.


Flipper is a platform for debugging mobile apps on iOS and Android and JS apps in your browser or in Node.js. Visualize, inspect, and control your apps from a simple desktop interface. Use Flipper as is or extend it using the plugin API.

Flipper

Table of Contents

Mobile development

Flipper aims to be your number one companion for mobile app development on iOS and Android. Therefore, we provide a bunch of useful tools, including a log viewer, interactive layout inspector, and network inspector.

Extending Flipper

Flipper is built as a platform. In addition to using the tools already included, you can create your own plugins to visualize and debug data from your mobile apps. Flipper takes care of sending data back and forth, calling functions, and listening for events on the mobile app.

Contributing to Flipper

Both Flipper's desktop app, native mobile SDKs, JS SDKs are open-source and MIT licensed. This enables you to see and understand how we are building plugins, and of course, join the community and help to improve Flipper. We are excited to see what you will build on this platform.

In this repo

This repository includes all parts of Flipper. This includes:

  • Flipper's desktop app built using Electron (/desktop)
  • native Flipper SDKs for iOS (/iOS)
  • native Flipper SDKs for Android (/android)
  • cross-platform C++ SDK (/xplat)
  • React Native Flipper SDK (/react-native)
  • JS Flipper SDK (/js)
  • Plugins (/desktop/plugins/public/)
  • website and documentation (/website, /docs)

Getting started

Please refer to our Getting Started guide to set up Flipper. Or, run npx flipper-server for a browser based version of Flipper.

Requirements

  • node >= 18
  • yarn >= 1.16
  • iOS developer tools (for developing iOS plugins)
  • Android SDK and adb

Building from Source

Desktop

Running from source

git clone https://github.com/facebook/flipper.git
cd flipper/desktop
yarn
yarn start

Building standalone application

Provide either --mac, --win, --linux or any combination of them to yarn build to build a release zip file for the given platform(s). E.g.

yarn build --mac

You can find the resulting artifact in the dist/ folder.

iOS SDK + Sample App

cd iOS/Sample
rm -f Podfile.lock
pod install --repo-update
open Sample.xcworkspace
<Run app from xcode>

You can omit --repo-update to speed up the installation, but watch out as you may be building against outdated dependencies.

Android SDK + Sample app

Start up an android emulator and run the following in the project root:

./gradlew :sample:installDebug

React Native SDK + Sample app

Requires RN 0.69+!

cd react-native/ReactNativeFlipperExample
yarn
yarn android

Note that the first 2 steps need to be done only once.

Alternatively, the app can be started on iOS by running yarn ios.

If this is the first time running, you will also need to run pod install --repo-update from the react-native/ReactNativeFlipperExample/ios folder.

React Native Windows (Experimental)

An experimental version of Flipper for React Native Windows is available. The following steps prepare the React Native Flipper project:

cd react-native/react-native-flipper
vcpkg install openssl:x64-uwp openssl:arm-uwp
vcpkg integrate install
yarn install
cd windows
nuget install ReactNativeFlipper/packages.config

In a nutshell, vcpkg is used to install OpenSSL. Nuget is used to install Boost.

Then, the sample application can be built and run as follows:

cd ../../ReactNativeFlipperExample
yarn install
yarn relative-deps
npx react-native run-windows

At the moment there's no available package for React Native Flipper. This means that to integrate Flipper with any other existing applications, an explicit reference to the project needs to be added just as is done with the sample application.

JS SDK + Sample React app

cd js/react-flipper-example
yarn
yarn start

Troubleshooting

Older yarn versions might show an error / hang with the message 'Waiting for the other yarn instance to finish'. If that happens, run the command yarn first separately in the directory react-native/react-native-flipper.

Documentation

Find the full documentation for this project at fbflipper.com.

Our documentation is built with Docusaurus. You can build it locally by running this:

cd website
yarn
yarn start

Contributing

See the CONTRIBUTING file for how to help out.

License

Flipper is MIT licensed, as found in the LICENSE file.

NPM DownloadsLast 30 Days