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

How to configure bubblewrap to build twa with different domains for production and development #892

Open
GorvGoyl opened this issue Nov 22, 2024 · 1 comment

Comments

@GorvGoyl
Copy link

GorvGoyl commented Nov 22, 2024

I am using Bubblewrap to build my PWA as a TWA Android app. I would like to know how I can configure the app to link to a development domain instead of the production domain for debugging and internal testing purposes.

Ideally, I would like to have one command to build the APK using the production domain and another command to build the APK using the development domain. Apk pointing to Dev domain need not be published on playstore as it's for internal testing only. Could you provide guidance or examples on how to achieve this setup?

PS: I'm using npm if that helps.

@paulirwin
Copy link

I'm also interested in this. Without first-class support for this in Bubblewrap, and in lieu of finding any other guidance, I had thought of a couple possible options:

  1. Keep separate environment apps in different folders in source control. Gross, and would require repeating work whenever changes need to be made, but would work if the customizations are small.
  2. Replace values in the generated files in a CI pipeline per environment. Could work, possibly fragile. Not sure yet how that works with fingerprints.
  3. Have environment-specific twa-manifest files and use shell scripting to move the files into place and run the bubblewrap CLI commands. I think I could get away with --skipVersionUpgrade and handle versioning separately, but that would be a concern to address.
  4. Look into calling bubblewrap directly from Gradle, and pulling in the TWA values from there, with the environment as a command-line argument. I'm not yet confident if this would work.
  5. Contribute back support for this to Bubblewrap, although I am not quite sure what that would look like just yet. I think generally this functionality could get away with just updating the build.gradle, if the Java package name can be separated from the app package ID. The Java package names could be constant across environments, but the app package ID would have to vary.

I'd appreciate if the Bubblewrap team has any suggestions, or to know if this functionality is planned for the near future.

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

2 participants