But for the moment I’m going to play it safe and just move everything over. Of this mess I suspect only the node executable is actually needed. The out/Release folder contains all the build artifacts for Node. So in fact my adb push command above isn’t from the Linux location but my Windows location. So I copy the Release folder from my Linux VM (via Virtualbox) and then use the linked drive to move it to my Windows box. Issue the command “adb push ~/node/out/Release /data/local/tmp/Release” But that isn’t my current priority so instead I need to just get node onto my device and play with it. On my Linux VM the build takes forever so now is a good time to get some fresh tea.Įventually I’ll write up an AAR that just wraps all the Node stuff and provides a standard API for launching node and feeding it a script. Apparently the rule of thumb is to set the value after j to 2x the number of hardware threads available on the machine. The actual instructions from the checkin say to run ’make -j8’ which enables parallel capabilities in Make. We linked the main version of Python (which any sane Linux distro will use) with the NDK so it will use that and hence support bz2. But if we want to build we have to get connected to a version of Python that does support bz2. This bug was reported to Node (since it breaks Node’s support of Android) but they responded that this is an NDK issue so Google should deal with it. In any sane world this just means that the NDK is broken but I’m sure there is some logic here. The NDK appears to ship with its own version of Python 2.7 that doesn’t support a library (bz2) that is needed by files in the NDK. Now go to ~/node/android-toolchain/bin and issue the command “mv python2.7 oldpython2.7 & ln -s /usr/bin/python2.7 python2.7” Run from inside of ~/node directory the command “source. I decided to leave platform=android-9 for no particularly good reason. Specifically 4.7 is apparently not supported by NDK 10 so I switched it to 4.8 which is. But the set up script is designed for an older version of the Android NDK. The first instruction will set up the build environment for Android. This is the pull request that added basic Android support to Node.Go edit ~/node/android-configure and change ’arm-linux-androideabi-4.7’ to instead be ’arm-linux-androideabi-4.8. I believe any modern Linux distro will have all of these already but just in case I decided to include the link. I am running these instructions off master branch.Ĭheck that you have all of node’s dependencies as listed here Let’s assume you put the NDK into ~/android-ndk-r10b. But my Linux OS (Elementary OS) is 64 bit so I want Linux 64-bit (x86) under Platform (32-bit target). Most Android devices today are 32 bit so I want the Platform (32-bit target). Which NDK to download does take a bit of attention. Yes, I did try the scripts in MINGW32 and no it didn’t work. These instructions don’t currently work on Windows due to issues with the sh scripts being used. The bad news is that at least at the time I’m writing this the build process requires a few extra steps. The good news is that Node.js does run on Android.
0 Comments
Leave a Reply. |