Skip to content
Snippets Groups Projects
Commit fcdbf1da authored by Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Committed by Sjoerd Simons
Browse files

Add run command to start application


Signed-off-by: default avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>

Differential Revision: https://phabricator.apertis.org/D5233
parent 2b955989
No related branches found
No related tags found
No related merge requests found
.TH ADE\-RUN 1 09/12/2016 0.1612.0 Apertis\ Development\ Tools\ Manual
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
ade-run \- Start an application
.SH SYNOPSIS
.sp
.nf
\fIade run\fR --app=<app> --simulator
\fIade run\fR --app=<app> --device [<user>[:<pass>]@]<hostname>[:<port>]
.fi
.sp
.SH DESCRIPTION
.sp
Start an application in simulator or on given device\&.
.sp
.SH OPTIONS
.sp
.PP
\fI\-\-app\fR
.RS 4
Absolute path to application to start\&.
.sp
.RE
.PP
\fI\-\-simulator\fR
.RS 4
Use simulator as target\&.
.sp
.RE
.PP
\fI\-\-device\fR
.RS 4
Use device as target (e.g. user@apertis)\&.
.sp
.RE
.SH SEE ALSO
ade(1)
.SH COPYRIGHT
Copyright (c) 2016 Collabora Ltd.
...@@ -93,6 +93,14 @@ Uninstall application from simulator or device\&. ...@@ -93,6 +93,14 @@ Uninstall application from simulator or device\&.
See \fBade-uninstall(1)\fR See \fBade-uninstall(1)\fR
.sp .sp
.RE .RE
.PP
\fIrun\fR
.RS 4
Start application in simulator or on device\&.
.sp
See \fBade-run(1)\fR
.sp
.RE
.SH SEE ALSO .SH SEE ALSO
ade-sysroot(1) ade-sysroot(1)
......
...@@ -174,6 +174,9 @@ class Simulator: ...@@ -174,6 +174,9 @@ class Simulator:
def uninstall(self, bundle_id): def uninstall(self, bundle_id):
self._exec('ribchester-bundle', 'remove', bundle_id) self._exec('ribchester-bundle', 'remove', bundle_id)
def run(self, app, *args):
self._exec('canterbury-exec', app, *args)
class Device: class Device:
def __init__(self, host, port=22, user=None, password=None): def __init__(self, host, port=22, user=None, password=None):
...@@ -248,6 +251,9 @@ class Device: ...@@ -248,6 +251,9 @@ class Device:
def uninstall(self, bundle_id): def uninstall(self, bundle_id):
self._exec('ribchester-bundle', 'remove', bundle_id) self._exec('ribchester-bundle', 'remove', bundle_id)
def run(self, app, *args):
self._exec('canterbury-exec', app, *args)
class SysrootVersion: class SysrootVersion:
...@@ -1127,34 +1133,34 @@ class Ade: ...@@ -1127,34 +1133,34 @@ class Ade:
if isinstance(obj, SDK): if isinstance(obj, SDK):
self.info("* SDK version is {0}{1}{2}" self.info("* SDK version is {0}{1}{2}"
.format(Colors.WARNING, self.obj.version, Colors.ENDC)) .format(Colors.WARNING, obj.version, Colors.ENDC))
if self.format == 'parseable': if self.format == 'parseable':
print("SDKVersion:{0}".format(self.obj.version.get_tag())) print("SDKVersion:{0}".format(obj.version.get_tag()))
if isinstance(obj, Sysroot): if isinstance(obj, Sysroot):
self.info("* Sysroot version {0}{1}{2} is installed at '{3}'" self.info("* Sysroot version {0}{1}{2} is installed at '{3}'"
.format(Colors.WARNING, self.obj.version, Colors.ENDC, self.obj.path)) .format(Colors.WARNING, obj.version, Colors.ENDC, obj.path))
if self.format == 'parseable': if self.format == 'parseable':
print("SysrootVersion:{0}".format(self.obj.version.get_tag())) print("SysrootVersion:{0}".format(obj.version.get_tag()))
print("SysrootPath:{0}".format(self.obj.path)) print("SysrootPath:{0}".format(obj.path))
elif isinstance(obj, Device): elif isinstance(obj, Device):
self.info("* Device has image version {0}{1}{2}" self.info("* Device has image version {0}{1}{2}"
.format(Colors.WARNING, self.obj.version, Colors.ENDC)) .format(Colors.WARNING, obj.version, Colors.ENDC))
if self.format == 'parseable': if self.format == 'parseable':
print("ImageVersion:{0}".format(self.obj.version.get_tag())) print("ImageVersion:{0}".format(obj.version.get_tag()))
elif isinstance(obj, Project): elif isinstance(obj, Project):
self.info("* Project: {0}{1}{2}".format(Colors.WARNING, self.obj.name, Colors.ENDC)) self.info("* Project: {0}{1}{2}".format(Colors.WARNING, obj.name, Colors.ENDC))
self.info("* BundleId: {0}".format(self.obj.bundle_id)) self.info("* BundleId: {0}".format(obj.bundle_id))
self.info("* Version: {0}".format(self.obj.version)) self.info("* Version: {0}".format(obj.version))
if self.format == 'parseable': if self.format == 'parseable':
print("ProjectName:{0}".format(self.obj.name)) print("ProjectName:{0}".format(obj.name))
print("BundleId:{0}".format(self.obj.bundle_id)) print("BundleId:{0}".format(obj.bundle_id))
print("AppVersion:{0}".format(self.obj.version)) print("AppVersion:{0}".format(obj.version))
elif isinstance(obj, Bundle): elif isinstance(obj, Bundle):
self.info("* BundleId: {0}".format(self.obj.id)) self.info("* BundleId: {0}".format(obj.id))
self.info("* Version: {0}".format(self.obj.version)) self.info("* Version: {0}".format(obj.version))
if self.format == 'parseable': if self.format == 'parseable':
print("BundleId:{0}".format(self.obj.id)) print("BundleId:{0}".format(obj.id))
print("AppVersion:{0}".format(self.obj.version)) print("AppVersion:{0}".format(obj.version))
def do_configure(self): def do_configure(self):
target = self.get_target() target = self.get_target()
...@@ -1225,6 +1231,10 @@ class Ade: ...@@ -1225,6 +1231,10 @@ class Ade:
except Exception as e: except Exception as e:
self.die("Couldn't uninstall application: {0}".format(e)) self.die("Couldn't uninstall application: {0}".format(e))
def do_run(self):
target = self.get_target()
target.run(self.app, self.args)
def info(self, message): def info(self, message):
if self.format == 'friendly': if self.format == 'friendly':
print(message) print(message)
...@@ -1333,6 +1343,14 @@ if __name__ == '__main__': ...@@ -1333,6 +1343,14 @@ if __name__ == '__main__':
group.add_argument('--simulator', help="Use simulator as target", action='store_true') group.add_argument('--simulator', help="Use simulator as target", action='store_true')
group.add_argument('--device', help="Use device as target (e.g. user@apertis)") group.add_argument('--device', help="Use device as target (e.g. user@apertis)")
# Run parser
run_parser = subparsers.add_parser('run', help="Run application")
run_parser.add_argument('--app', help="Remote path to application to run")
group = run_parser.add_mutually_exclusive_group()
group.add_argument('--simulator', help="Use simulator as target", action='store_true')
group.add_argument('--device', help="Use device as target (e.g. user@apertis)")
run_parser.add_argument('args', help="Configure options", nargs=argparse.REMAINDER)
argcomplete.autocomplete(root_parser) argcomplete.autocomplete(root_parser)
obj = Ade() obj = Ade()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment