Before you start, you'll need a device with an unlocked bootloader, otherwise you won't be able to run adb root (or any of the commands that require root). For Googlers, follow this link
and follow the instructions before returning to this page.
- Configure your working copy to build Android binaries.
- Make sure you're doing a static build. Component build will not work for any of the following steps.
- Build and configure a proxy from your device to your local machine:
ninja -C out/Release forwarder
adb shell mkdir /data/tmp
adb push out/Release/forwarder /data/tmp/forwarder
adb shell /data/tmp/forwarder 4444:4444
you will have to run adb root and the last command again if you reboot your device
Build and install the Mojo Shell APK, and run it with the Sample App.
Build the mojo_shell_apk target and push it to your device:
- Run gyp
Build the sample application:
- ninja -C out/Release mojo_shell_apk
- adb install -r out/Release/apks/MojoShell.apk
Run an HTTP server on your local machine:
- ninja -C out/Release package_mojo_sample_app
Run Mojo Shell on the device:
- cd out/Release/apps
python -m SimpleHTTPServer 4444 &
See what happened:
- ./build/android/adb_run_mojo_shell http://127.0.0.1:4444/libmojo_sample_app.so
Linux & Windows
- Switch to the shared library build and enable aura:
Build mojo_shell and sample_app:
- export GYP_DEFINES="$GYP_DEFINES component=shared_library use_aura=1"
- gclient runhooks
Run an HTTP server:
- ninja -C out/Release mojo_shell mojo_sample_app
Run Mojo Shell:
- cd out/Release/lib
- python -m SimpleHTTPServer 4444
- ./out/Release/mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:mojo_sample_app
The value of --origin will be used for all mojo: urls, both passed on the command line and requested by the apps themselves. Specifying --disable-cache will ensure that all caching attributes are ignored, as they can cause apps to not be updated when rebuilt.