Skip to content

Instantly share code, notes, and snippets.

@gardner
Created May 15, 2016 05:34
Show Gist options
  • Save gardner/fdd93deac685d794a7e04872dd153267 to your computer and use it in GitHub Desktop.
Save gardner/fdd93deac685d794a7e04872dd153267 to your computer and use it in GitHub Desktop.
build scuttlebot for android
# This only works on linux. I used Ubuntu 15.
install node + npm
nvm install v5
download android sdk
download android ndk
apt-get install build-essential libssl-dev libtool -y
clone the node repo
cd node
# This adds buildable support for PIE executables. Try building tag v4.2.3 if you want ELF.
git checkout 271201fea935cdf85336736e87c06104ce185f61
./android-configure ~/android-ndk-r11c/
# On Android /data/local/tmp/ is the only place that you can write to and set executable permissions on files
adb push scuttlebot /data/local/tmp/scuttlebot
adb push node /data/local/tmp/node
adb shell
cd /data/local/tmp/scuttlebot
export HOME=/data/local/tmp
../node ./sbot.js
../node ./bin.js
# At this point is was not creating a manifest so I copied mine over from my dev machine
adb push ~/.ssb/manifest.json /data/local/tmp/.ssb/manifest.json
# Even after updating bin.js to use ../node as the binary, we're still getting:
shell@shamu:/data/local/tmp/scuttlebot $ ./bin.js server
error loading sodium bindings: Cannot find module 'chloridedown/build/Release/sodium'
falling back to javascript version.
Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment