import platform


def format_build_command(command):
  """Format a command string so that it runs in the Anroid build environment.

  Args:
    command: Command to format.

  Returns:
    Command modified to run in the Android build environment.
  """
  environment = []
  if platform.system() == 'Darwin':
    environment.append('export BUILD_MAC_SDK_EXPERIMENTAL=1')
  return ' && '.join(environment + ['source ./build/envsetup.sh', command])