def launchapp(self, cmd, args=[], delay=<NUM_LIT:0>, env=<NUM_LIT:1>, lang="<STR_LIT:C>"):
try:<EOL><INDENT>atomac.NativeUIElement.launchAppByBundleId(cmd)<EOL>return <NUM_LIT:1><EOL><DEDENT>except RuntimeError:<EOL><INDENT>if atomac.NativeUIElement.launchAppByBundlePath(cmd, args):<EOL><INDENT>try:<EOL><INDENT>time.sleep(int(delay))<EOL><DEDENT>except ValueError:<EOL><INDENT>time.sleep(<NUM_LIT:5>)<EOL><DEDENT>return <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>raise LdtpServerException(u"<STR_LIT>" % cmd)<EOL><DEDENT><DEDENT>
Launch application.

@param cmd: Command line string to execute.
@type cmd: string
@param args: Arguments to the application
@type args: list
@param delay: Delay after the application is launched
@type delay: int
@param env: GNOME accessibility environment to be set or not
@type env: int
@param lang: Application language to be used
@type lang: string

@return: 1 on success
@rtype: integer

@raise LdtpServerException: When command fails