Build Native app locally best practice

0
I followed the docs on https://docs.mendix.com/refguide/mobile/distributing-mobile-apps/building-native-apps/native-build-locally/ and now have a better understanding on building native apps. The Docs are there to get you started , if your only option is to build the app locally and can't use bitrise or appcircle what is the best way to go about this, Do I hav e to create a new folde everytime I have to create a native build and go through that process everytime or is there a better way to do it ?
asked
4 answers
0

Hi Mfundo,

You do not need to create a new Native Template folder or perform a complete native build every time you make changes to your Mendix application.

Mendix recommends starting with a local build to understand the native build process. Once the local build is working correctly, you can automate the process using Bitrise or Appcircle.

Here is the recommended approach:

1. Initial local setup

  • Use the Mendix Native Mobile Builder to create and configure your Native Template.

  • Install the required development tools:

    • Android: Android Studio and Android SDK.

    • iOS: macOS, Xcode, and CocoaPods.

  • Configure the application and generate the native project.

  • Build and test the application locally.

You can reuse the same Native Template project for subsequent builds. You do not need to create a new folder every time.

2. When do you need a new native build?

A new native binary is required when you make changes that affect the native application itself, for example:

  • Adding a new native module or native dependency.

  • Updating the Native Template.

  • Upgrading Studio Pro when it requires a new Native Template.

  • Changing the application name or launcher icons.

  • Changing the splash screen.

3. When is a new native build NOT required?

For supported applications with Mendix OTA updates enabled, changes such as the following can be delivered by deploying the updated Mendix application:

  • Page and layout changes.

  • Styling and static asset changes.

  • Microflow and nanoflow changes.

  • JavaScript Action changes.

  • Adding or removing supported widgets.

The installed native app receives the updated bundle when it restarts and connects to the runtime.

4. Automate the build process

Once your local build is stable, you can configure a CI/CD pipeline:

  • Bitrise: Automate Android and iOS builds using workflows.

  • Appcircle: Automate builds, signing, testing distribution, and publishing.

This avoids manually building and distributing the native application for every release.

My recommendation

Use this workflow:

Initial Setup
     |
     v
Configure Native Template
     |
     v
Build Locally
     |
     v
Test on Android / iOS
     |
     v
Configure Bitrise / Appcircle
     |
     v
Automated Builds and Distribution

Important: OTA updates must be enabled and the application must have been released with OTA support before relying on them. OTA cannot replace a full native release when native dependencies or the Native Template change.

Official Mendix documentation:

Hope this helps! If you find this answer helpful, please mark it as the accepted answer.

answered
0

Hi Mfundo,

You don’t need a new folder for every build. Most changes don’t even need a new build if you turn on over-the-air (OTA) updates.

1. Over-the-air (OTA) updates

A Mendix native app has two parts:

  • the native wrapper, which is the APK or IPA installed from the store

  • the JavaScript bundle, which holds your pages, logic and assets

With OTA turned on, the bundle is downloaded from your Mendix environment. When you redeploy the app to your environment, users get the changes automatically the next time they restart the app. It doesn’t update while the app is open or minimized.

How to turn it on

  1. In Studio Pro, open Navigation → Native mobile profile and select Enable over-the-air updates.

  2. Deploy the app to your environment.

  3. Make one new native build and distribute it. Only apps built after you turn OTA on can receive OTA updates.

Updated with just a redeploy (OTA)

  • Pages, layouts and styling

  • Nanoflows, microflows and JavaScript actions

  • Adding or removing JavaScript-only widgets and modules

  • Images and other static assets

  • Non-destructive domain model changes (be careful with offline-first apps)

Needs a new native build and store release

  • New native modules or widgets that include native code

  • Native Template updates, or a Studio Pro or Mendix upgrade that needs a newer Native Template

  • Changing the app name, launcher icon or splash screen

  • Any direct change to the Android or iOS project.

2. Local builds: reuse the same folder

When a new native build is needed, you don’t start over:

  1. Create the native project folder once and keep it under version control (Git).

  2. For each new release, use the same folder:

    • Rerun the build step from Studio Pro against that folder, so the latest bundle is copied into the existing project.

    • Increase the version number (versionCode and versionName in android/app/build.gradle, or the version and build number in Xcode for iOS).

    • Build the APK or AAB in Android Studio, or the IPA in Xcode.

  3. Regenerate or upgrade the folder only when the Native Template changes, for example after a Mendix upgrade that needs a newer template.

In short: turn on OTA once and ship most changes by redeploying the app. Keep one native project folder and rebuild from it, with a higher version number, only when a native-level change needs a store release.

Hope this helps! If this solution works for you, kindly mark it as the accepted answer so it can help others facing the same issue.

Sources:

answered
0

Hi Mfundo,

You do not need to create a new Native Template folder every time you want to generate a native build. Once you have completed the initial local setup, you can reuse the existing native project for subsequent builds.

Here is the recommended approach:

1. Complete the initial local setup

  • Follow the Mendix documentation to generate the Native Template.

  • Install and configure the required development tools.

    • Android: Android Studio, Android SDK and the required Java environment.

    • iOS: macOS, Xcode and CocoaPods.

  • Generate the native project and complete your first local build.

  • Test the generated application on your device or emulator.

Once this setup is working, keep the native project folder in a dedicated location and preferably maintain it under version control using Git.

2. Reuse the existing Native Template

For subsequent builds, you can reuse the same native project folder instead of repeating the entire setup process.

  • Make the required changes in your Mendix application.

  • Generate or update the native project using Studio Pro.

  • Check whether any native dependencies or configuration changes are required.

  • Run the build process again using Android Studio or Xcode.

  • Test the newly generated application.

This avoids reinstalling dependencies and configuring the development environment for every build.

3. Understand when a new native build is required

Not every Mendix application change requires generating a new APK or IPA.

A new native build is generally required when you:

  • Add or update native modules or dependencies.

  • Upgrade the Native Template.

  • Make changes directly to the Android or iOS native project.

  • Change native application configurations, such as app icons or splash screens.

For regular changes to pages, layouts, microflows, nanoflows and supported JavaScript-only widgets, you can use over-the-air (OTA) updates if they are enabled and supported by your application.

4. Consider automating the process

If local builds are your only option, you can simplify the process by maintaining a reusable build environment and automating repetitive commands through scripts.

You can also maintain separate native project folders for different Mendix applications or template versions to avoid configuration conflicts.

My recommendation:

Start with one successful local build, preserve the generated Native Template and its dependencies, and reuse that setup for future builds. Only regenerate or upgrade the native project when there are changes that require it.

This approach will save time, avoid unnecessary setup work and make the local native build process easier to maintain without depending on Bitrise or Appcircle.

Official documentation:

Hope this helps! If you find this answer useful, kindly mark it as the accepted answer so it can help others facing a similar question.

answered
0

Hi Mfundo,

One additional best practice if you're building locally only:

Keep your generated Native Template project under Git version control and treat it as a long-lived project rather than a temporary build folder.

In most cases I:

  • Create the Native Template once.

  • Keep Android/iOS configuration, signing settings, icons, and splash screens in that project.

  • Reuse the same folder for every release.

  • Only regenerate or upgrade the template when Mendix requires a newer Native Template version or when adding libraries with native code.

Also, maintain a simple release checklist:

  1. Update Mendix app.

  2. Sync/update the native project.

  3. Increment versionCode / versionName (Android) or Build Number (iOS).

  4. Generate APK/AAB or IPA.

  5. Test on a physical device before distribution.

If you're the only developer building locally, this approach saves a lot of time and avoids repeatedly configuring Android Studio/Xcode settings.

So, no, you shouldn't create a new folder for every build. Reuse the same native project and only recreate it when there's a Native Template or native dependency change.

answered