Skip to main content

SeeTestAutomation - Launch With Options

info

Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .

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

KeyTypeDescriptionOS
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);

launchOptionsMap.put("launch_env",envVars);

client.launch("com.experibank.eribank",launchOptionsMap);

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");

client.launch("com.experibank.eribank",launchOptionsMap);

Example - Ruby - Pass CMD line arguments during launch

 # launch Settings in es locale:
load "Client.rb"
client = Mobile::Client.new('127.0.0.1', 8889, true)
client.setDevice("ios_app:#B0107 iPhone7+")
client.launch2("com.apple.Preferences", {
"relaunch" => true,
"launch_args" => ["-AppleLanguages", "(es)", "-AppleTextDirection", "NO", "-AppleLocale", "es"]
})
client.releaseClient();
info
  • 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