Revision: 10410
Author: [email protected]
Date: Mon Jan 16 06:18:36 2012
Log: Created wiki page through web user interface.
http://code.google.com/p/v8/source/detail?r=10410
Added:
/wiki/D8OnAndroid.wiki
=======================================
--- /dev/null
+++ /wiki/D8OnAndroid.wiki Mon Jan 16 06:18:36 2012
@@ -0,0 +1,83 @@
+#summary Explains how to compile d8 for Android devices and run it.
+
+
+=Prerequisites=
+ * a Linux workstation
+ * v8 r10409 or later
+ * an Android device and matching USB cable
+
+
+=Get the Android NDK=
+ * tested versions: r6b, r7
+ * download the NDK from http://developer.android.com/sdk/ndk/index.html
+ * extract it
+ * in a shell, `cd` to the extracted NDK's root directory, and from there
run:
+{{{
+build/tools/make-standalone-toolchain.sh --platform=android-9
--install-dir=toolchain
+}}}
+ "--platform=android-9" is for Gingerbread and above; please note that you
*have to* use "--install-dir=toolchain" for the `make` command below to
work!
+ * export `$ANDROID_NDK_ROOT` in your shell (or `~/.bashrc`, or whatever)
+
+
+=Get the Android SDK=
+ * tested version: r15
+ * download the SDK from http://developer.android.com/sdk/index.html
+ * extract it
+ * install the "Platform tools" using the SDK manager that you can start
by running `tools/android`
+ * now you have a `platform_tools/adb` binary which will be used later;
put it in your `PATH` or remember where it is
+
+
+=Set up your device=
+ * Enable USB debugging (Gingerbread: Settings > Applications >
Development > USB debugging; Ice Cream Sandwich: Settings > Developer
Options > USB debugging)
+ * connect your device to your workstation
+ * make sure `adb devices` shows it; you may have to edit `udev` rules to
give yourself proper permissions
+ * run `adb shell` to get an ssh-like shell on the device. In that shell,
do:
+{{{
+cd /data/local
+mkdir v8
+cd v8
+}}}
+
+
+=Push stuff onto the device=
+ * make sure your device is connected
+ * from your workstation's shell:
+{{{
+adb push /file/you/want/to/push /data/local/v8/
+}}}
+
+
+=Compile V8 for Android=
+ * compile:
+{{{
+make android -j16
+}}}
+ * push the resulting binary to the device:
+{{{
+adb push out/android.release/d8 /data/local/v8/d8
+}}}
+ * the most comfortable way to run it is from your workstation's shell as
a one-off command (rather than starting an interactive shell session on the
device), that way you can use pipes or whatever to process the output as
necessary:
+{{{
+adb shell /data/local/v8/d8 <parameters>
+}}}
+ * warning: when you cancel such an "adb shell whatever" command using
Ctrl+C, the process on the phone will sometimes keep running.
+
+
+=Profile=
+ * compile a binary, push it to the device, keep a copy of it on the host
+{{{
+make android -j16
+adb push out/android.release/d8 /data/local/v8/d8-version.under.test
+cp out/android.release/d8 ./d8-version.under.test
+}}}
+ * get a profiling log and copy it to the host:
+{{{
+adb shell /data/local/v8/d8-version.under.test benchmark.js --prof
+adb pull /data/local/v8/v8.log ./
+}}}
+ * open `v8.log` in your favorite editor and edit the first line to match
the full path of the `d8-version.under.test` binary on your workstation
(instead of the `/data/local/v8/` path it had on the device)
+ * run the tick processor with the host's `d8` and an appropriate `nm`
binary:
+{{{
+cp out/ia32.release/d8 ./d8 # only required once
+tools/linux-tick-processor
--nm=$ANDROID_NDK_ROOT/toolchain/bin/arm-linux-androideabi-nm
+}}}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev