|
midp — device emulator and Java™ programming language interpreter for the Mobile Information Device Profile (MIDP).
midp [ -classpath path ] [ -Dproperty=value ] [ -heapsize size ] command-switch midp_g [ -classpath path ] [ -Dproperty=value ] [ -heapsize size ] command-switch
The midp command runs a device emulator and executes bytecodes that have been created by the compiler, javac, and preverified by the preverify utility. The midp_g command is a version of the midp command built with debug capabilities. Unless otherwise noted, running the midp or midp_g command displays a device skin.
MIDP is part of the Java 2 Platform, Micro Edition (J2ME™). MIDP was initially defined in the Mobile Information Device Profile for the J2ME Platform [JSR-000037], and refined in the Mobile Information Device Next Generation [JSR-000118]. For more information on the JSRs, see http://www.jcp.org/jsr/tech/j2me.jsp
Applications that the midp command runs are called MIDlets. When one or more MIDlets are packaged as a unit for download onto a device, the bundle is called a MIDlet suite. The midp command can run MIDlets and MIDlet suites.
In addition to running MIDlets and MIDlet suites, the midp command manages MIDlet suites. It can download and install them on the emulator, list the MIDlet suites installed on the emulator, remove a MIDlet suite from the emulator, and so on.
The behavior of the emulator during MIDlet execution is controlled by configuration files:
\build\share\lib\internal.config — Properties that enable MIDP to better simulate the capabilities of a device (such as number of colors). \build\share\lib\system.config — Properties that describe the MIDP environment (such as the version number of the MID profile).Where midpInstallDir is the directory where MIDP is installed. The files are property files that use a colon to separate the property name from its value:
White space around the colon is not significant.
The tables below describe the properties in each file.
To permanently change a property value, edit the appropriate file. To temporarily change a property value, use the -D command-line option to the midp command.
The following options are supported:
none
Running the tool without options launches the device emulator’s graphical user interface.
-classpath path
Specifies the directories, zip files, and JAR files to search for Java class files. This argument is passed to CLDC.
-Dproperty=value
Overrides the value of property set in the configuration file. This argument is passed to CLDC.
-heapsize size
Specifies the amount of memory to be set aside for the heap, specified as number of bytes (such as 65536), number of kilobytes (such as 128k) or number of megabytes (such as 1M). This argument is passed to CLDC.
The minimum heap required to run the midp executable when there are no applications installed on the emulator is 32k. (When applications are installed, the minimum amount varies but is never lower than 32k.)
The following command switches are supported:
-autotest [ -domain domain ] descriptorURL
Repeatedly installs, runs, and removes the first MIDlet from the MIDlet suite described by the Java application descriptor (JAD) file at the descriptorURL location. (The JAD file specifies the location of its corresponding JAR file.)
This command installs the MIDlet suite into domain. If domain is not provided the domain maximum is used. The command removes the MIDlet suite when it gets a 404 code from the server.
-debugger [ -port portNumber ]
Starts the MIDP executable in debug mode. The portNumber should be the number of the port on which the KVM debug proxy expects the debugger to be running. See the KVM documentation for more information on this and other options that are available for a MIDP executable in debug mode.
-help
Prints text to standard output that describes the options to the midp command and exits.
Note: Using the -help switch does not display the device skin.
-install [ -force ] [ -domain domain ] [ -removeRMS ] descriptorURL
Installs the MIDlet suite represented by the JAD file at descriptorURL location. This command installs the MIDlet suite into domain. If domain is not provided, and the suite is unsigned, the default domain, untrusted, is used.
Using -removeRMS removes any persistent data written by any previous versions of the MIDlet suite. This option only has an affect if the installation is overwriting an existing installation of the MIDlet suite.
Using -force has the MIDP Reference Implementation runtime ignore any overwrite errors that occur during the installation.
Note: Using the -install command-switch does not display the device skin.
-list
Prints information to standard output on the installed MIDlets, including their names, vendors, descriptions, storage names, sizes, original locations (URLs), and lists of MIDlets.
Note: Using the -list switch does not display the device skin.
-remove ( suitenumber | storagename | all )
Removes the installed MIDlet suite identified by the given suitenumber or storagename, or removes all MIDlet suites.
Note: Using the -remove switch does not display the device skin.
-run ( suitenumber | storagename ) [ MIDletName ]
Runs the installed MIDlet suite that is identified by suitenumber or storagename. The suitenumber is the number displayed by the -list option to the midp command, and storagename is the name displayed by the -storageNames option to the midp command.
If suitenumber or storagename identifies a MIDlet suite that contains multiple MIDlets, MIDletName can specify a particular MIDlet in the suite to run.
-storageNames
Prints to standard output the storage names of the installed MIDlet suites. Storage names of MIDlets are implementation dependent.
Note: Using the -storageNames switch does not display the device skin.
-transient [ -force ] [ -domain domain ] [ -removeRMS ]
descriptorURL [ MIDletName ]
Downloads, installs, runs, and removes the MIDlet suite represented by the JAD file at the descriptorURL location. This command installs an unsigned MIDlet suite into domain. If domain is not provided for an unsigned MIDlet suite, the default, untrusted, is used.
If the JAD file at descriptorURL describes a MIDlet suite that contains multiple MIDlets, MIDletName can specify a particular MIDlet in the suite to run.
Using -removeRMS removes any persistent data written by any previous versions of the MIDlet suite. This option only has an affect if the installation is overwriting an existing installation of the MIDlet suite.
Using -force has the MIDP Reference Implementation runtime ignore any overwrite errors that occur during the installation.
-version
Returns the version of the MIDP Specification with which this release is compliant, the version of the MIDP implementation, and the version of the configuration (CLDC) with this release.
Note: Using the -version switch does not display the device skin.
The following example installs the Games MIDlet suite from the URL http://localhost:8080/midlets/games.jad:
c:\midp2.0fcs> bin\midp -install http://localhost:8080/midlets/games.jad
Storage name: #Sun%0020#Microsystems%002c%0020#Inc%002e_#Sun#Samples%0020%00d%0020#Games_
The following example installs the same unsigned MIDlet suite, but assigns it to the trusted domain:
c:\midp2.0fcs> bin\midp -install -domain trusted http://localhost:8080/midlets/games.jad
Storage name: #Sun%0020#Microsystems%002c%0020#Inc%002e_#Sun#Samples%0020%00d%0020#Games_
The following example lists the MIDlet suites installed on the device emulator. It shows the command being run on an emulator that has one MIDlet suite installed.
C:\midp2.0fcs>bin\midp -list [1] Name: HttpView Vendor: Sun Microsystems, Inc. Version: 2.0 Authorized by: CN=thehost;OU=JCT;O=dummy CA;L=Santa Clara;ST=CA;C=US Description: This midlet is .... Storage name: #Sun%0020#Microsystems%002c%0020#Inc%002e_#Http#View_ Size: 17K Installed From: http://localhost:8080/midlets/pushdemo.jad MIDlets: HttpView HttpTest
The following example runs the MIDlet suite listed in the previous example. It provides the number associated with the MIDlet.
c:\midp2.0fcs> bin\midp -run 1
Appendix D, "The preverify Tool”
Chapter 2, "Using the midp Executable”
|
Using MIDP MIDP Reference Implementation, Version 2.0 FCS |
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.