Skip to main content

SeeTest Client - 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.

You must pass the environment variables or command-line arguments as a MAP or JSON 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>/ JSON ArrayAn ordered array of command line argsiOS
launch_envMap<String,String>/ JSON ObjectSet of key = value pairs that will be passed as Environment variables to the applicationiOS
verifybooleanWhether or not to verify that the application is still in the foreground when the launch ends.



If not specified, defaults to true.



Set this option to false if the application is not expected to stay in the foreground after it is launched.
iOS
initial_waitbooleanWhether or not to wait for the application to launch and idle.



If not specified, defaults to true.



Set this option to false in order to speed up the launch process, and not wait for the application to idle.



If set to false, it is client responsibility to handle synchronisation issues and verify launch succeeded.
iOS
<adb-option-key><adb-option-value>key-value pairs of adb extra options



This is supported only for Appium grid, not Appium Server.
Android
  • 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.ExperiBank",launchOptionsMap);

Example - Java launch iOS App with options and pass JSON as environment variables

JsonObject launchOptions = new JsonObject();
launchOptions.addProperty("relaunch", true);
// Create ENV vars JSON Object to pass to the application so it will run in DEBUG with a secret key
JsonObject envVars = new JsonObject();
envVars.addProperty("secret_key", "DFSF5343543CAA");
envVars.addProperty("DEBUG", true);

launchOptions.add("launch_env",envVars);
client.launchWithOptions("com.experitest.ExperiBank", launchOptions.toString());

Example - Java launch Android App with adb options as Map

// 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 - Java launch Android App with adb options as JSON String

// Launch app as non-instrumented, use relaunch
JsonObject launchOptions = new JsonObject();
launchOptions.addProperty("instrumented", false);
launchOptions.addProperty("relaunch", true);
// Add adb params
launchOptions.addProperty("-D", "");
launchOptions.addProperty("--es", "android.intent.extra.TEXT Hello");

client.launchWithOptions("com.experitest.ExperiBank/.LoginActivity",launchOptions.toString());

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