Page tree
Skip to end of metadata
Go to start of metadata

SeeTest allows you to pass Environment variables and command line arguments to the application during the launch process.

Users are required to pass the environment variables or command line arguments as a MAP of the key-value set which is passed to the application

Supported Keys

relaunchbooleanWhether or not to kill the application in case it is runningAndroid & iOS
instrumentbooleanLaunch the application in an instrumented modeAndroid
launch_argsList<String>An ordered array of command line argsiOS
launch_envMap<String,String>Set of key = value pairs that will be passed as Environment variables to the applicationiOS
<adb-option-key><adb-option-value>key-value pairs of adb extra optionsAndroid
  • Instrumentation in iOS is determined during installation.

The examples below show a couple of use cases for this feature for users who are using JAVA \ Ruby Clients, this command is supported for all SeeTestAutomation clients

Example - Java launch iOS App with options and pass map as environment variables
// Use relaunch
Map <String, Object> launchOptionsMap = new HashMap ();
launchOptionsMap.put("relaunch", true);
// Create ENV vars map to pass to the application so it will run in DEBUG with a secret key
Map envVars = new HashMap();
envVars.put("secret_key", "DFSF5343543CAA");
envVars.put("DEBUG", true);


Example - Java launch Android App with adb options
// Launch app as instrumented, use relaunch
Map <String, Object> launchOptionsMap = new HashMap ();
launchOptionsMap.put("instrumented", true);
launchOptionsMap.put("relaunch", true);
// Create adb params map to pass 
launchOptionsMap.put("-D", "");
launchOptionsMap.put("--es", "android.intent.extra.TEXT Hello");

Example - Ruby - Pass CMD line arguments during launch
 # launch Settings in es locale:
load "Client.rb"
client ='', 8889, true)
client.setDevice("ios_app:#B0107 iPhone7+")
client.launch2("", {
    "relaunch" => true,
    "launch_args" => ["-AppleLanguages", "(es)", "-AppleTextDirection", "NO", "-AppleLocale", "es"]
  • In iOS:

When passing to the application ENV vars or CMD line ARGS Make sure that you also pass the key "relaunch" with value `true` so that the application will be able to parse these arguments

  • In Android:

Options are:

      • -D: Enable debugging.
      • -W: Wait for launch to complete.
      • --start-profiler file: Start profiler and send results to file.
      • -P file: Like --start-profiler, but profiling stops when the app goes idle.
      • -R count: Repeat the activity launch count times. Prior to each repeat, the top activity will be finished.
      • -S: Force stop the target app before starting the activity.
      • --opengl-trace: Enable tracing of OpenGL functions.
      • --user user_id | current: Specify which user to run as; if not specified, then run as the current user.
      • --es: extra custom options
  • No labels