How do I determine the profile selected for EAS during side-by-side installation

I want to do side-by-side installation but I was wondering is there a way of detecting that I am doing

eas build --profile development

which is what I use to build the development client so that I can do this

module.exports = () => {
  if (process.env.WHAT_SHOULD_I_USE === 'development') {
    return {
      ios: { bundleIdentifier: 'dev.expo.example.dev' },
      android: { package: 'dev.expo.example.dev' },
    };
  }
};

You can put WHAT_SHOULD_I_USE in the env section of your build profile in eas.json, and use it exactly like in your code sample:

{
  "build": {
    "production": {
      "env": {
        "WHAT_SHOULD_I_USE": "production"
      }
    }
  }
}
1 Like

Combining with what you have my app.config.ts looks like this

import type { ExpoConfig } from "@expo/config";
export default ({ config }: { config: ExpoConfig }) => {
  return {
    ...config,
    name: process.env.APP_NAME ?? config.name,
    ios: {
      bundleIdentifier: process.env.BUNDLE_ID ?? config.ios?.bundleIdentifier,
    },
    android: {
      package: process.env.BUNDLE_ID ?? config.android?.package,
    },
  };
};

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.