Android Run Settings | Qt Creator Documentation
Description: Settings for running applications on Android devices.

- Qt Creator Documentation
- Android Run Settings
- Qt Creator 17.0.1

Reference

# Android Run Settings

Specify settings for running applications on the Run device that you select for a kit in Projects > Build & Run > Run > Run Settings.

To run and debug an application on an Android device, you must create connections from the development host to the device, as instructed in Developing for Android.

## am Start Options

Qt Creator applies a default set of Android Activity manager (am) start options when starting applications. You can specify additional start options in the Activity manager start arguments field. However, if the default options conflict with the added options, the application might not start.

The default arguments for the Activity manager for a normal run:

     am start -n <package_name>/<QtActivity_name>

The default arguments for the Activity manager for the debugger mode:

     am start -n <package_name>/<QtActivity_name> -D

For example, to run the application as a particular user, enter the start option `--user 10`, where `10` is the user ID of the user account.

## Shell Commands

You can specify shell commands to run before the application starts and after it quits. For example, enter the following commands into Pre-launch on-device shell commands to unlock the screen and to switch to the user account `10` on the device before running the application:

     input keyevent 82
     am switch-user 10

Enter the following commands into Post-quit on-device shell commands to switch back to the default user, `0`, and to unlock the screen after the application is quit:

     am switch-user 0
     input keyevent 82

See also Activate kits for a project, Configure projects for running, How To: Develop for Android, and Kits.

Reference