Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Snorkel23 opened this issue Apr 18, 2024 · 9 comments
Open

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

Snorkel23 opened this issue Apr 18, 2024 · 9 comments

Comments

@Snorkel23
Copy link

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?

@hewers
Copy link

hewers commented Apr 21, 2024

For example, I hit a dependency issue. Fitbit CLI uses npm 14, but some dependencies here report needing 18. Trying yarn with npm 18 now.

yarn when using npm 14:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=18". Got "14.21.3"
error Found incompatible module. 

@hewers
Copy link

hewers commented Apr 24, 2024

@Snorkel23 I think that we use yarn within fitbit-app-versa4-main, and we move our clockface/app source files into it.

@Snorkel23
Copy link
Author

@Snorkel23 I think that we use yarn within fitbit-app-versa4-main, and we move our clockface/app source files into it.

Hi, thanks.
So I've copied the files from app, resources and the package.json files to fitbit-app-versa4-main. I've done yarn install and yarn build successfully now in this directory.
Then I turn on debugging and try "export FITBIT_QA_COMMANDS=1" in the npx console and it gives "export is not recognized as an internal or external command".
I tried skipping to the next step in case that was necessary and did yarn debug, 'export' isn't a valid command in that console either, and neither is the 'hosts' command of the following step.

@Snorkel23
Copy link
Author

Snorkel23 commented Apr 24, 2024

Oh, I guess the package.json file, I should be using the one that's with fitbit-app, not my own app.
If I do that, the "yarn install" command gives "couldn't find the binary git"

Edit: Installed Git, now that works.

@hewers
Copy link

hewers commented Apr 24, 2024 via email

@Snorkel23
Copy link
Author

Export that QA variable in bash.

Thank you!

Now the app is on my watch <3

@Snorkel23
Copy link
Author

Snorkel23 commented Apr 25, 2024

I had some more problems with permissions, but now it's all sorted.

In case it's useful to other people, what I did in the end was - used my own project, I make a hybrid package.json file, starting with my app's file (with its permissions and whatnot), edited in the dev dependencies and build targets from cmengler's version. I also copied the .gitignore and the .nvmrc files to my project.

I installed git when it gave an error about not finding the binary git.
Edit: Also I did this with Node v18 installed.

Then I opened a command console and did (from my clockface directory)
yarn install
yarn build
bash
export FITBIT_QA_COMMANDS=1
export FITBIT_DEVBRIDGE_DUMP=1
yarn debug
hosts
connect phone
connect device
build-and-install

I clearly have no idea what I'm doing here, so please excuse me if some steps were redundant. But this got it working for me.

Thanks so much for the help @hewers

@cmengler
Copy link
Owner

Sorry for coming in late! Thank you @hewers :)

Happy to hear you've got it working @Snorkel23 :)

I'll revisit this process as there may have been a few updates to the Fitbit CLI/SDK since (and hopefully fewer steps required). I'll push any new updates to the repo if that's the case :)

@hewers
Copy link

hewers commented Apr 26, 2024

connect phone and connect device are automatic upon bi (build and install)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants