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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »


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

Users are required to pass the environment variables or command line arguments as MAP of 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 & iOS
launch_argsList<String>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


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
// Launch app as instrumented, use relaunch
Map <String, Object> launchOptionsMap = new HashMap ();
launchOptionsMap.put("instrument", true);
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("instrument", 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();
  • 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