// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page creator-run-settings-android.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-android

    \title Specify Android run settings

    To specify settings for running applications on the \l {Managing kits}{Run device} that
    you select for a kit, go to \uicontrol Projects > \uicontrol {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
    \l {Developing for Android}.

    \section1 am start options

    \QC applies a default set of Android Activity manager (am) start options when
    starting applications. You can specify additional start options in the
    \uicontrol {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:

    \badcode
    am start -n <package_name>/<QtActivity_name>
    \endcode

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

    \badcode
    am start -n <package_name>/<QtActivity_name> -D
    \endcode

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

    \image {qtcreator-android-run-settings.webp} {Run Settings for an Android device}

    \section1 Shell commands

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

    \code
    input keyevent 82
    am switch-user 10
    \endcode

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

    \code
    am switch-user 0
    input keyevent 82
    \endcode

    \sa {Activate kits for a project}, {Configure projects for running},
    {Android}{How to: Develop for Android}, {Developing for Android},
    {Managing kits}
*/
