Resources | Resources |



TM.exe command-line usage

TM.exe is the command line version of Target Manager.

You can use the TM.exe to do the following:

  • List profiles
  • Create, delete, and start and stop targets
  • List targets
  • Query targets for properties

To use the commands

  1. Open a command-prompt and navigate to the location of TM.exe on your machine. The default installation is C:\Program Files\Qualcomm\Brew MP SDK\\bin.
  2. To display help information, in the command prompt enter:
    1. For all help options:
      tm.exe help
    2. For detailed information:
      tm.exe help 

      For example:

      tm.exe help ka

    The following are the commands:

    Command Description
    lp Lists the profiles that are currently in the system
    lt Lists all the targets known to the system
    td Writes the full path to the target's root directory to the console
    c Creates a new target from the specified profile
    d Deletes the specified target from the system
    start [-t = timeout] Starts execution of the specified target , the name should be enclosed in quotes if it contains spaces, i.e. "candy bar 1.0.2". Optional parameter -t is for timeout. If the target does not start within this number of milliseconds, it is considered failure. Default is 10,000 (10 seconds).
    rm Removes files or directories from a target
    k Terminates the target process for the specified target, if the target is running.
    cp Copies files or directories to/from a target.
    sa Starts an applet or program on target.
    w Causes TM.exe to wait until the target has completely initialized.
    gas Gets the status of an application on the target.
    ka Stops the application on the target.
    gpi Gets the process id of the running target
    gtd Gets the path of the target directory
    std Sets the target directory
    gpd Gets the path of the profiles directory
    spd Modifies the directory location for profiles. Profiles in the current directory will have to be manually moved to the new directory to continue using them
    gca Gets the applications that are connected to or will be connecting to target

Using Target Manager to load applications to a target

TM.exe can be used to load applications to a Simulation target. For physical targets, use CT.exe (see Connect Tool Help in the Tools Reference). Prior to working in the command prompt, place the application files you need to run the application on the Simulator in one folder to make the copy process faster. Generally this includes the application MIF, DLL, and optional BAR file. Then you can copy the contents of that folder to the target in one command.

  1. Open a command-prompt and navigate to the location of TM.exe on your machine. The default location is <%Brew MP SDK%\Toolset 1.0 Rev x\bin>
  2. For a list of known targets, enter the following in the command prompt:

    tm.exe lt

  3. Once you have the name of the desired target to copy the application files to, enter the following in the command prompt.

    tm.exe copy TargetName SourcePath DestinationPath

    TargetName is the name of the desired target, as it was listed in the command prompt, contained in quotes, i.e. "Sapphire". SourcePath is the source of the file/directory to be copied. DestinationPath is the destination path of the file or directory to be copied. The following is an example:

    TM.exe copy C:/brewapps/c_samplesms/files fs:/usermods/c_samplesms

    Where "files" is the folder containing the application MIF, DLL and BAR.

  4. Once the application files are copied, you can launch the target process without a UI by typing the following in the command prompt:

    TM.exe start TargetName

  5. Once the target is running, the application can be launched on the target from the Target Manager command line. The following command starts the application on target:

    TM.exe StartApp TargetName CLSID:ProgramName

    Where CLSID is the ClassID of the application to start. The following is an example:

    TM.exe StartApp "Sapphire" 0x0108f318

    You should see a message that the application with the provided ClassID has started.

  6. The following command produces the same result as double-clicking a target in the Target Manager UI.

    Simulator.exe ["target name"][-c]

    The -c parameter tells the UI to connect to the running target rather than start it.