Giter Site home page Giter Site logo

cmengler / fitbit-app-versa4 Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 3.0 34 KB

Unofficial approach for sideloading an app onto Fitbit Versa 4 (and possibly Sense 2) devices

License: MIT License

JavaScript 57.54% CSS 42.46%
fitbit fitbit-sdk fitbit-app fitbit-app-development fitbit-sense fitbit-sense2 fitbit-versa fitbit-versa4 fitbit-watch-app

fitbit-app-versa4's Introduction

Fitbit Versa 4 App

This is an unofficial approach for building and sideloading a 3rd-party application to Fitbit Versa 4 and Sense 2 devices.

๐Ÿšง All content within this repository is provided for educational purposes only. Use at your own risk. ๐Ÿšง

This approach consists of:

  • Enables the hosts command via the FITBIT_QA_COMMANDS environment flag.
  • Uses unofficial drop-in package for @fitbit/sdk-build-targets
  • Sets the enableProposedAPI for installs.

Screenshots

App List App
app list app

Quick Start

To summarise in four steps:

Build the app

cd app && \
yarn install && \
yarn build

Prepare the bridge

Open Fitbit app, access the Developer Menu, toggle on Developer Bridge and wait for the "Waiting for Studio" status.

On the Versa 4/Sense 2, connect the device to charger, goto Settings and navigate to Developer bridge, toggle USB debugging on.

Enable the FITBIT_QA_COMMANDS environment flag, this allows the device USB host to be discoverable.

export FITBIT_QA_COMMANDS=1

Optionally enable the FITBIT_DEVBRIDGE_DUMP environment flag to capture all developer bridge protocol messages for debugging purposes.

export FITBIT_DEVBRIDGE_DUMP=1

Connect the devices

NOTE: When you first start the debug command, you may be requested to login to your Fitbit developer account.

yarn debug

Once connected and the fitbit$ prompt is ready, type hosts to verify the watch and phone (companion host) can be found.

fitbit$ hosts
Device Hosts:
[
  {
    displayName: 'Hera',
    available: true,
    roles: [ 'APP_HOST' ],
    connect: [AsyncFunction: connect]
  }
]
Phone Hosts:
[
  {
    available: true,
    connect: [Function: connect],
    displayName: 'Samsung SM-G991B',
    roles: [ 'COMPANION_HOST' ]
  }
]

Now, connect! First start with connect phone, followed by connect device.

fitbit$ connect phone
Auto-connecting only known phone: Samsung SM-G991B
fitbit$ connect device
Auto-connecting only known device: Hera

Install the app

fitbit$ build-and-install

> [email protected] build
> fitbit-build

[warn][build] Targeting proposed API may cause your app to behave unexpectedly. Use only when needed for development or QA.
[warn][settings] This project is being built without a settings component. Create a file named settings/index.tsx, settings/index.ts, settings/index.jsx or settings/index.js to add a settings component to your project.
[info][app] Building app for Fitbit Versa 4
[info][companion] Building companion
[info][build] App UUID: 2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1, BuildID: 0x09256fc65528043a
No app package specified. Reloading ./build/app.fba.
Loaded appID:2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1 buildID:0x09256fc65528043a
App install complete (full)
Companion install complete (full)
Launching app
Companion: Loaded and evaluated: file:///android_asset/bootstrap.js                                                                                (js-engine-bootstrap.html:9,1)
Companion: Companion code started                                                                                                                        (companion/index.js:5,1)
Companion: Loaded and evaluated: file:///data/user/0/com.fitbit.FitbitMobile/app_companions/2bcb9c0f-493b-4ec5-9fe0-07039a28ffa1/0x09256fc65528043a/companion.js                                                                                                                                                                                 (js-engine-bootstrap.html:9,1)
Companion: Companion launched by [launchedOnTracker]

fitbit-app-versa4's People

Contributors

cmengler avatar educatedcaveman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fitbit-app-versa4's Issues

yarn install fails with "No such file or directory: 'install'"

Session log:

# git clone https://github.com/cmengler/fitbit-app-versa4.git
  Cloning into 'fitbit-app-versa4'...
  remote: Enumerating objects: 45, done.
  remote: Counting objects: 100% (45/45), done.
  remote: Compressing objects: 100% (32/32), done.
  remote: Total 45 (delta 11), reused 36 (delta 7), pack-reused 0
  Unpacking objects: 100% (45/45), done.

# cd fitbit-app-versa4/app/
# yarn install
  Command 'yarn' not found, but can be installed with:
  apt install cmdtest

# apt install cmdtest
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following additional packages will be installed:
    python python-chardet python-cliapp python-markdown python-pkg-resources
    python-pygments python-ttystatus python-yaml
  Suggested packages:
    python-doc python-tk python-xdg python-markdown-doc python-setuptools ttf-bitstream-vera
  The following NEW packages will be installed:
    cmdtest python python-chardet python-cliapp python-markdown python-pkg-resources
    python-pygments python-ttystatus python-yaml
[... installing yarn happened here ...]

# yarn install
  00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'
  
# pwd
  /mnt/e/devel/FitBit/fitbit-app-versa4/app
  
# ls
  index.js

Looks like yarn is looking for a file or folder app/install which is not included in this repo?

Update - Works on Sense 2!

I was recently looking into developing an app for Fitbit until the sudden realisation there's no official way to develop one for a Sense 2.

I came across this repo and decided to try it and wanted to say that this works on a Sense 2. Noticed it says 'possibly works on Sense 2' so hopefully you can rename/change repo accordingly.

Created a simple cookie clicker, screenshots below:

App List App
App List Cookie Clicker

Cannot see the device as a host!

I just got my Versa 4 and was super stoked to use the SDK to built my own watch faces.
Was crushed when I found out they don't support Versa 4 - what a weird move from Fitbit (I guess Google?).

I'm trying the guidelines laid out in this article but I cannot see my Versa 4 as a host, though I see it in my list of connected USB devices.
Screenshot 2023-08-25 at 16 56 10

Any ideas?
Thanks for doing this btw. I hope I get it working.

App cannot be build.

Whenever I try to build app I get this Error:
package.json One or more build targets was invalid: hera, rhea

License

does this have a license? I used this as a starting point for a watchface I did and want to check if I could open source it.

Can you give more details on how to use your code?

Sorry, I'm really rusty on coding, and I'm lost.

I've downloaded "Yarn-master", and it seems to be installed.
I've downloaded "fitbit-app-versa4-main".
I have a fitbit clockface I made, that I'd like to try installing on my Sense 2.

The instructions to "Build the app"
cd app &&
yarn install &&
yarn build

I'm not certain whether this is referring to my clockface app or your app? 'yarn build' gives an error when run in the 'app' folder (and root folder) of 'fitbit-app-versa-main', but does something when I do it in my clockface folder, but then the "export" command gives "'export' is not recognized as an internal or external command, operable program or batch file."

I'm very confused about which programs I should be running with which other programs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.