Android » History » Revision 2
« Previous |
Revision 2/6
(diff)
| Next »
Yi Huang, 12/20/2014 01:02 PM
Android¶
To run cross-compiled NFD binary on rooted Android device, there are several steps:
Preparation:
- 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.)
- Get cross-compiled NFD binary
- Get Android SDK. (I use adb
"shell"
to open up a shell to run NFD) - Enable development mode on the Android device.
Steps to run NFD on rooted Android devices:
Copy binaries and configuration file to sdcard of the phone. To do this, you can:
a. Use
"adb push"
command; orb. Use other applications like "Android File Transfer" on OS X.
On terminal, type
"adb shell"
to get a shell on Android phone.Run
su
to switch to root user. (You might need to click "allow" on your phone to grant super user privilege if you have never done so.)Copy binary from sdcard to
/data/local/tmp
. (You must usecp
,mv
won't work for this case.)Use
"chmod 700"
on all binaries to make them executable. (syntax like"u+x"
won't work on Android.)Modify nfd.conf and comment out websocket section and unix socket section.
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 about 10 years ago · 6 revisions