Project

General

Profile

Android » History » Version 1

Yi Huang, 12/20/2014 10:45 AM

1 1 Yi Huang
Android
2
=======
3
4
To run cross-compiled NFD binary on rooted Android device, there are several steps:
5
6
Preparation:
7
8
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.)
9
2. Get cross-compiled NFD binary
10
3. Get Android SDK. (I use adb ```"shell"``` to open up a shell to run NFD) 
11
4. Enable development mode on the Android device.
12
13
Steps to run NFD on rooted Android devices:
14
15
1. Copy binaries and configuration file to sdcard of the phone. To do this, you can:
16
17
    a. Use ```"adb push"``` command; or
18
19
    b. Use other applications like "Android File Transfer" on OS X.
20
21
2. On terminal, type ```"adb shell"``` to get a shell on Android phone.
22
23
3. Copy binary from sdcard to ```/data/local/tmp```. (You must use ```cp```, ```mv``` won't work for this case.)
24
25
4. Use ```"chmod 700"``` on all binaries to make them executable. (syntax like ```"u+x"``` won't work on Android.)
26
27
5. Modify nfd.conf and comment out websocket section and unix socket section.
28
29
6. Run nfd binary with environment variable ```HOME``` pointing to a writable place. For example ```"HOME=/data/local/tmp ./nfd --config ./nfd.conf"```