Project

General

Profile

Actions

Android » History » Revision 1

Revision 1/6 | Next »
Yi Huang, 12/20/2014 10:45 AM


Android

To run cross-compiled NFD binary on rooted Android device, there are several steps:

Preparation:

  1. A rooted Android device. (It has to be rooted or no one can run binaries copied to sdcard from command line. It is possible to use an Android application wrapper to carry and run native binaries on unrooted device. I have not test that yet since we need to do debugging on command line and wrapper is just too complicated for debugging.)
  2. Get cross-compiled NFD binary
  3. Get Android SDK. (I use adb "shell" to open up a shell to run NFD)
  4. Enable development mode on the Android device.

Steps to run NFD on rooted Android devices:

  1. Copy binaries and configuration file to sdcard of the phone. To do this, you can:

    a. Use "adb push" command; or

    b. Use other applications like "Android File Transfer" on OS X.

  2. On terminal, type "adb shell" to get a shell on Android phone.

  3. Copy binary from sdcard to /data/local/tmp. (You must use cp, mv won't work for this case.)

  4. Use "chmod 700" on all binaries to make them executable. (syntax like "u+x" won't work on Android.)

  5. Modify nfd.conf and comment out websocket section and unix socket section.

  6. Run nfd binary with environment variable HOME pointing to a writable place. For example "HOME=/data/local/tmp ./nfd --config ./nfd.conf"

Updated by Yi Huang almost 6 years ago · 1 revisions