Commit 8a64baca authored by Adam Barth's avatar Adam Barth

Merge pull request #241 from abarth/sky_shell_apk

Create a SkyShell.apk
parents 765881f2 c14ba336
......@@ -68,19 +68,19 @@ Running a Sky application
-------------------------
The `sky` pub package includes a `sky_tool` script to assist in running
Sky applications inside the `SkyDemo.apk` harness. The `sky_tool` script
Sky applications inside the `SkyShell.apk` harness. The `sky_tool` script
expects to be run from the root directory of your application's package (i.e.,
the same directory that contains the `pubspec.yaml` file). To run your app,
follow these instructions:
- `./packages/sky/sky_tool start` to start the dev server and upload your
app to the device.
(NOTE: add a `--install` flag to install `SkyDemo.apk` if it is not already
(NOTE: add a `--install` flag to install `SkyShell.apk` if it is not already
installed on the device.)
- Use `adb logcat` to view any errors or Dart `print()` output from the app.
`adb logcat -s sky` can be used to filter only adb messages from
`SkyDemo.apk`.
`SkyShell.apk`.
Debugging
---------
......
......@@ -17,10 +17,6 @@ android_library("java") {
"//base:base_java",
"//mojo/public/java:bindings",
"//mojo/public/java:system",
"//mojo/services/sensors/public/interfaces:interfaces_java",
"//services/sensors:sensors_lib",
"//sky/services/media:media_lib",
"//sky/services/media:interfaces_java",
"//sky/shell:java",
]
}
......
......@@ -6,15 +6,7 @@ package org.domokit.sky.demo;
import android.content.Context;
import org.chromium.mojo.sensors.SensorServiceImpl;
import org.chromium.mojo.system.Core;
import org.chromium.mojo.system.MessagePipeHandle;
import org.chromium.mojom.media.MediaService;
import org.chromium.mojom.sensors.SensorService;
import org.domokit.media.MediaServiceImpl;
import org.domokit.sky.shell.ResourceExtractor;
import org.domokit.sky.shell.ServiceFactory;
import org.domokit.sky.shell.ServiceRegistry;
import org.domokit.sky.shell.SkyApplication;
/**
......@@ -35,23 +27,4 @@ public class SkyDemoApplication extends SkyApplication {
super.onBeforeResourceExtraction(extractor);
extractor.addResources(DEMO_RESOURCES);
}
@Override
public void onServiceRegistryAvailable(ServiceRegistry registry) {
super.onServiceRegistryAvailable(registry);
registry.register(SensorService.MANAGER.getName(), new ServiceFactory() {
@Override
public void connectToService(Context context, Core core, MessagePipeHandle pipe) {
SensorService.MANAGER.bind(new SensorServiceImpl(context), pipe);
}
});
registry.register(MediaService.MANAGER.getName(), new ServiceFactory() {
@Override
public void connectToService(Context context, Core core, MessagePipeHandle pipe) {
MediaService.MANAGER.bind(new MediaServiceImpl(context, core), pipe);
}
});
}
}
......@@ -21,9 +21,9 @@ SKY_PACKAGE_ROOT = os.path.realpath(os.path.dirname(LIB_DIR))
SKY_SERVER_PORT = 9888
OBSERVATORY_PORT = 8181
APK_NAME = 'SkyDemo.apk'
ANDROID_PACKAGE = "org.domokit.sky.demo"
ANDROID_COMPONENT = '%s/%s.SkyDemoActivity' % (ANDROID_PACKAGE, ANDROID_PACKAGE)
APK_NAME = 'SkyShell.apk'
ANDROID_PACKAGE = "org.domokit.sky.shell"
ANDROID_COMPONENT = '%s/%s.SkyActivity' % (ANDROID_PACKAGE, ANDROID_PACKAGE)
# FIXME: This assumes adb is in $PATH, we could look for ANDROID_HOME, etc?
ADB_PATH = 'adb'
# FIXME: Do we need to look in $DART_SDK?
......@@ -243,7 +243,7 @@ class StartTracing(object):
def run(self, args, pids):
subprocess.check_output([ADB_PATH, 'shell',
'am', 'broadcast',
'-a', 'org.domokit.sky.demo.TRACING_START'])
'-a', 'org.domokit.sky.shell.TRACING_START'])
TRACE_COMPLETE_REGEXP = re.compile('Trace complete')
......@@ -260,7 +260,7 @@ class StopTracing(object):
subprocess.check_output([ADB_PATH, 'logcat', '-c'])
subprocess.check_output([ADB_PATH, 'shell',
'am', 'broadcast',
'-a', 'org.domokit.sky.demo.TRACING_STOP'])
'-a', 'org.domokit.sky.shell.TRACING_STOP'])
device_path = None
is_complete = False
while not is_complete:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment