Scripts Page
This page allows users to configure script commands to apply to the device.
<>
Angle brackets indicate required fields[]
Square brackets indicate optional fields
BATTERY_OPTIMIZATION
- Syntax
- Example
BATTERY_OPTIMIZATION <action> <package>
# limit Gmail's battery usage
BATTERY_OPTIMIZATION ENABLE com.android.google.gm
Enables or disables battery optimization for the given package.
-
action
- Required parameter. Allowed values:ENABLE
- enable battery optimization for the given package. i.e. the app's background processing capability will be diminished for the sake of improved battery life.DISABLE
- the given package will not be limited by the battery optimization feature in any way. Could result in decreased battery life.
-
package
- Package name of the app for which battery optimization should be adjusted.
BROADCAST
- Syntax
- Example
BROADCAST <arguments>
BROADCAST -a datalogic.action.test -n com.datalogic.test/TestBroadcastReceiver --es extra_key "extra_string_value"
Broadcasts the intent with the specified intent arguments. Supported extra arguments:
- -e | -es - Add string data as a key-value pair
- -ef - Add float data as a key-value pair
- -ei - Add integer data as a key-value pair
- -el - Add long data as a key-value pair
- -ez - Add boolean data as a key-value pair
COPY
- Syntax
- Example
COPY <source-file-path> <target-file-path> <overwrite>
COPY /sdcard/Download/test.apk /sdcard/MyApps/test.apk true
Copies a file located on-device from one location to another. If the target-file-path does not exist, it will be automatically created for you, even multiple folders deep if necessary.
-
source-file-path
- the full path to the source file to be copied, starting with/
. -
target-file-path
- the full path to the destination location where the file should be copied to. Should include the destination file name as well. -
overwrite
- true or false. if set to true, the copy should overwrite an existing file. if set to false, the copy should not overwrite an existing file.
DELETE
- Syntax
- Example
DELETE <path> [pattern] [include]
DELETE /sdcard/Download/Test *.apk true
Recursively deletes files/folders starting from path
, only if the name matches the pattern
regular-expression. If folder path
is empty at the end of the process it will be deleted, as well.
-
pattern
- Optional regular expression to match. Often, this would just be the name of the file to be deleted. Default value:"^.+$"
(i.e. delete all files with names one or more characters long). -
include
- Optional value. Ifinclude
istrue
, the matching entries will be deleted. Ifinclude
is false, the non-matching entries will be deleted. Default value:true
.
INFLATE
- Syntax
- Example
INFLATE <archive-path> <target-path>
INFLATE /sdcard/Download/test.zip /sdcard/Download/Unzipped
Inflates the ZIP archive found at archive-path
to target-path
folder.
INSTALL
- Syntax
- Example
INSTALL <apk-path>
INSTALL /sdcard/Download/myapp.apk
Installs an application given a complete path to an installable APK.
INSTALL_KEY_MAPPING
- Syntax
- Example
INSTALL_KEY_MAPPING <file-path> [persistence-type]
INSTALL_KEY_MAPPING /sdcard/Download/testKeyboard.zip ENTERPRISE_RESET_PERSISTENT
Installs a new keyboard configuration.
file-path
- required path to keyboard editor zip file.persistence-type
- Optional persistence modifier. Defaults to REBOOT_PERSISTENT if not specified. Allowed values:REBOOT_PERSISTENT
- keyboard configuration will persist through normal device rebootsENTERPRISE_RESET_PERSISTENT
- keyboard configuration will persist through enterprise resets
LAUNCH
- Syntax
- Example
LAUNCH <package-name>
LAUNCH com.datalogic.dxu
Starts the launching intent given an application package-name
.
SET_SETTING
- Syntax
- Example
SET_SETTING <namespace> <setting> <value>
SET_SETTING volume_ring 2
Set a system setting. namespace must be one of: GLOBAL, SECURE, or SYSTEM.
SHELL
- Syntax
- Example
SHELL <adb_shell_command>
SHELL ime reset
Run an arbitrary adb shell command. This is an experimental feature. Not all shell commands that work at an adb shell prompt will work here. No output that may be provided in the command will be displayed.
-
adb_shell_command
- the adb shell command to run. This could be any command you can run at an adb shell prompt, although the adb shell has different permission levels than Scan2Deploy, so there is no guarantee if the command will run successfully or not. -
Android's official documentation for SHELL command can be found here.
UNINSTALL
- Syntax
- Example
UNINSTALL <package-name>
UNINSTALL com.company.app
Uninstalls a previously installed application given its package-name
.
WAIT
WAIT <milliseconds>
Suspend the script execution for milliseconds
milliseconds.