App development workflow

Posted on
  • What is your workflow to test an app? I think I'm doing it wrong. I do:

    • change local code
    • Use GitHub Desktop to commit changes
    • Push changed to "master" - I think, that's my forked repository
    • Wait for Actions to finish
    • Go to https://MY_NAME.github.io/BangleApps
    • disconnect gadgetbridge
    • connect to Bangle.JS
    • uninstall the app
    • re-install the changed app
    • disconnect + reconnect to phone
    • send a message
    • see it doesn't work
    • try not to curse
    • repeat

    I'm messing with the 'messages' app, so I need to test notifications from gadgetbridge

  • Writing Code in Bangle IDE (or VSCode)
    Upload to Bangle or emulator.
    repeat.

    When finished: commit to repo, push.

    Ah forgot: For testing notifications, I switch the BT connection from PC to phone for the test OR simulate the message in the code (from doc):

    GB({"t":"notify","id":1592721712,"src":"­WhatsApp","title":"Sample Group: Sam","body":"This is a test WhatsApp message"})
    
  • this is interesting, it was some time ago here on the forum:

    https://github.com/diesphink/banglejs2-f­iles-watcher

    I haven't tested it yet.

  • The web IDE has "watch & upload".

  • Yes. But how do you use an app with 3+ files in the web IDE?
    And how do you send the test notification in the web IDE?

  • ah, now I understand. Interesting problem. I never had changes to more than one file. It is possible to connect more than one web IDE window/tab to a Bangle - one for each file. However I didn't try it so I can't say whether this is really working or not.

  • Now I see. You're just loading the one file that you change, and all the other files stay untouched in the memory? I didn't get it.

  • Yes. But how do you use an app with 3+ files in the web IDE?

    You can open 3x Web IDE windows connected to the same watch usually :)

    And how do you send the test notification in the web IDE?

    You can just paste the GB(...) commands into the left-hand side of the IDE. Some example commands are listed at http://www.espruino.com/Gadgetbridge#mes­sages-sent-to-bangle-js-from-phone

    The nice thing about faking it is if there are any errors, they get displayed in the IDE console where you can pick them up :)

  • I see. But it does not work on the emulator, does it?
    I get errors like "export" is not defined... And the emulator switches to a whit screen with an image: "Loading..." "2c12 Emulated".

    But I get it. First test in the IDE, then push to the repo.

  • I see. But it does not work on the emulator, does it?

    Yes, it will do - but you have to have all the relevant parts installed in the emulator, which is a real pain. Definitely worth just using a real device for.

    I get errors like "export" is not defined...

    That's what happens when you upload an library and it tries to run the library as if it was an app. Generally I'd just issue load() in the LHS of the IDE right after, but if you're doing it a lot you can go to IDE settings -> communications -> Load after saving and change it to something other than 'load the just-uploaded file'.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

App development workflow

Posted by Avatar for gfric @gfric

Actions