Implement a Linux version of the Fitbit OS simulator

Currently, the Fitbit OS simulator only supports Windows and macOS hosts. There are certainly developers out there who use Linux as their primary (or even only) development OS. It shouldn't be too difficult to maintain Linux port of the simulator since it is built using the cross-platform Electron framework, which officially supports Linux.

I successfully installed and ran Windows variant of the simulator using the Wine (version 3.0 on Ubuntu 16.04 LTS), and it properly connects with the Fitbit Studio. Applications run with no problems. The only thing that currently does not work is switching the device type from Ionic (default) to Versa. Doing so will always crash the simulator. If the simulator properly ran under Linux, it would be kind-of solution for developing Fitbit OS apps from Linux. The real port of the simulator would be even better, though.

25 Comments
MorrisTimm
Recovery Runner

Do you have any special settings for Wine to make it work? For me the simulator crashes immediately if I try to start it via Wine.

st33vil
Jogger

I have made no special settings for the simulator. Maybe I made some tweaks to Wine in the past, I don't remember.

I regularly installed the simulator (Fitbit OS Simulator Setup 0.5.1.exe) from the terminal. Afterwards, I found the simulator executable in the following directory: ~/.wine/drive_c/users/your_username/Local Settings/Application Data/Programs/@fitbitsimulator

While in that directory, I ran the following command:

wine Fitbit\ OS\ Simulator.exe

After that, you log in with your developer account and connect to virtual devices from the Fitbit Studio.

The big deal is that, no matter what I tried, I couldn't get the Versa simulator running. Smiley Frustrated

SunsetRunner
Not applicable

Thanks for the suggestion @st33vil. We understand the concern (and it's great that you were able to make most of it working with Wine), but unfortunately it's not on our roadmap for now. I would still like to let this feature suggestion open so people can comment and add votes as we may re-evaluate this in the future.

st33vil
Jogger

I understand, @SunsetRunner, and thanks for your reply. I'm sure you'll re-evaluate this in the future if the community demand will be high enough.

Still, it would be of great help if you just fix the Windows version of the simulator so that we can change the device type to Versa when running under Wine. It's a major issue for the app developers and probably just a minor fix for the simulator developers.

stillpointx
Jogger

I also would like to use the simulator under linux specifically Ubuntu.  What would be required to get it to work under WINE?

stillpointx
Jogger

The simulator executable in the following directory: ~/.wine/drive_c/users/your_username/Local Settings/Application Data/Programs/@fitbitsimulator

 

Runing from the terminal in that directory using the command "wine Fitbit\ OS\ Simulator.exe"

Gives an error message

err:module:import_dll Library UIAutomationCore.DLL (which is needed by L"C:\\users\\rt\\Local Settings\\Application Data\\Programs\\@fitbitsimulator\\Fitbit OS Simulator.exe") not found
err:module:import_dll Library ncrypt.dll (which is needed by L"C:\\users\\rt\\Local Settings\\Application Data\\Programs\\@fitbitsimulator\\Fitbit OS Simulator.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\users\\rt\\Local Settings\\Application Data\\Programs\\@fitbitsimulator\\Fitbit OS Simulator.exe" failed, status c0000135

 

SunsetRunner
Not applicable

@st33vil: I can't promise anything for the Windows fix on WINE as it's working on Windows itself. It would mean supporting the simulator on WINE, which we can't do for now and it may break in future changes too. In the meantime, if you need help with tests, please let me know in private if I can help.

stillpointx
Jogger

I've created a How to: to get Fitbit Simulator 2.0 working on Linux / Ubuntu 18.04 and Wine 3.0

 

How to instructions

 

Video: Installing / getting Fitbit 2.0 simulator to run in Ubuntu 18.04 

 

 

 

mhelvens
Base Runner

The lack of Linux support makes me sad, especially for software development tools. And it confuses me. Isn't Linux the de-facto OS for software development? Or is that just me?

Osleg
First Steps

I would vote this up.

There is a lot of linux developers around the globe.

I know main TA of fitbit is US of A where most of developers use MacOS, yet linux developers are here too and our `fit` matters too 😉

Please add support for linux, at least for Ubuntu, community will port it to other distributions without problem.

Giampi71
5K Racer

Pixelbook is now supporting Linux apps. I strongly support the need of having a Fitbit OS Simulator for Linux.

sovanyio
Jogger

I second the above statement. Also developing on a pixelbook.

Curiously, I have the simulator working correctly on another arch based machine, must be something with the debian wine builds, likely some package is missing.

RonTidd
First Steps

A linux simulator would be ideal.

Alternately making the simulator an Android app would work too

iphone app would be nice - if you are personally bent that way 😉

bicycle4health
Recovery Runner

I am Linux only developer, so this is a must for me!

briandamaged
First Steps

Linux is my preferred software development environment as well.  Is there anything I can do to help get the FitBit simulator tested/released for Linux?

adiroiban
Base Runner

Check the instructions on the winehq website. After installing the fonts, the simulator works on Ubuntu 18.04.

 

When I start the simulator, I see 4 consecutive "Program Error" messages. I just click the "Cancel" button and it continues.

 

Note that when you change from Ionic to Versa inside the simulator settings, it will crash... but the configuration changes are saved.

 

You should wait for about 10 seconds before restarting the simulator again.

 

My wild guess of the cause : it looks like the simulator is creating some local socket...these sockets are left open after a crash.. and if you restart the simulator too quickly, it will try to connect to the previous sockets...instead of creating new ones.

Renno
Recovery Runner

I've created a docker image to run the fitbit OS simulator and it is working quite well. It uses wine, though.

eljenso
First Steps

@RennoCan you please share this image? Can't get the Simulator to work on Ubuntu 19.04.

Renno
Recovery Runner

Sorry, @eljenso 

 

Almost one year late response... the docker image is here: https://github.com/rennomarcus/dockerimages/tree/master/fitbitos

 

 

BingRen
Base Runner

Thanks @Renno for sharing his docker image.

 

Renno's image was built better than the instructions on WineHQ (https://appdb.winehq.org/objectManager.php?sClass=version&iId=36675). At lease with one app that I'm building, when I loaded it to the simulator launched according to the WineHQ instruction, the app crashed the simulator (though the initial app does not crash). Using Renno's image the app can be tested without crashing the simulator.

 

Inspired by his image, I built a new image with the latest simulator (0.8.2) and also a starter to properly launch it so that the container can use host's GUI. Now, you can launch the simulator with command

 

 

 

npx fitbit-sim-starter

 

 

This command will handle everything - downloading the starter, running the starter, pulling the image, properly launching the container and authorizes the container to show GUI on host's X server. 

 

The Dockerfile can be found here https://github.com/bingtimren/fitbit-simulator-linux-wine-image

The starter project can be found here https://github.com/bingtimren/fitbit-sim-starter

 

 

 

 

 

 

HmmWhy
Jogger

Wanted to bump this in 2021, as for me it is a rather pressing issue for fitbit development.

 

Was able to configure Ubuntu to run version 0.8.2 of the simulator using Wine on Ubuntu 18 and now 20 relatively easily. This works great for developing the older SDK for Fitbit Versa, Versa Lite, and Versa 2. 

 

Since 0.9.0 was released with support for the new Devices (Sense and Versa 3) I have found no working configuration to get the simulator running (without immediately crashing) which prevents me from developing for the newer SDK on Linux which is a serious bummer.

BingRen
Base Runner

@HmmWhy try `npx fitbit-sim-starter`. It's upgraded to 0.9.0. Find more details at https://github.com/bingtimren/fitbit-sim-starter

 

FLav0ured
Recovery Runner

@BingRen I am trying to use the npm package you suggested on Linux Mint 20.3 Cinnamon but when the simulator is running it says "Device bridge is disconnected". In the terminal I get the following error:

ERR: SSL error: unable to get local issuer certificate

I already tried the solution suggested in this thread and copied the certificate provided by BeatYT to /home/<me>/.wine/drive_c/users/<me>/Local Settings/Application Data/Programs/@fitbitsimulator/resources/static/devicesim/win/higgs/ but sadly it did not change the issue. Do you have any idea?

BingRen
Base Runner

@FLav0ured did you copy to inside the container? `fitbit-sim-starter` runs the simulator inside a container. If you copied to your local directory it would not work.

 

Anyway, I upgraded the simulator image and also included the fix. Now you can try to run again

 

 

fitbit-sim-starter -u -r

 

You can check if you are running the latest image by verifying the digest

 

$ docker ps
CONTAINER ID   IMAGE                                           COMMAND       CREATED         STATUS         PORTS     NAMES
cbfc833d7d61   bingtimren/fitbit-simulator:linux_wine_latest   "/bin/bash"   3 minutes ago   Up 3 minutes             fitbit-sim-starter-socket

$ docker image ls --digests
REPOSITORY                    TAG                 DIGEST                                                                    IMAGE ID       CREATED          SIZE
bingtimren/fitbit-simulator   linux_wine_latest   sha256:466f76049c7aafa6624bc8c42445abaaa2d3672ef36dd4fc46fba9e4980c2016   47f65a54e99f   40 minutes ago   3.31GB

 

 

FLav0ured
Recovery Runner

I just tried the new version of the fitbit-sim-starter npm and it works like a charm. Well done @BingRen. Thank you very much! As you suspected I just copied the certifcate to some place on my drive where I found the original certificate not really knowing what I was doing. 😅 Thank you for your input and your super fast response. I appreciate it a lot.

To comment, you must first accept the terms of the Idea and Feedback Submission policy.