nodejs android ios,GitHub - aniwei/nodejs-mobile: Node.js on Android and (coming soon) iOS

Node.js on Mobile

This project is an experimental fork of nodejs/node-chakracore bringing Node.js to mobile operating systems, as a library that can be embedded in mobile applications and frameworks.

It currently only builds for Android (with V8), as a shared library for the armeabi-v7a architecture. Support for iOS and additional Android architectures are in the works and will be published soon.

Project Goals

The goals of this project are:

To provide the fixes necessary to run Node.js on mobile operating systems.

To investigate which features need to be added to Node.js in order to make it a useful tool for mobile app development.

To diverge as little as possible from nodejs/node and nodejs/node-chakracore, while fulfilling goals (1) and (2).

Download

Documentation

Samples and instructions on how to embed the binaries into mobile applications can be found in the samples repo.

Disclaimer: documentation found in this repository is currently unchanged from the parent repository and may only be applicable to node-chakracore.

Build Instructions

Prerequisites to build the Android library on Linux Ubuntu/Debian:

Basic build tools:

sudo apt-get install -y build-essential git python

Install curl and unzip (needed to download the Android NDK):

sudo apt-get install -y curl unzip

Install Android NDK r15c for Linux:

Choose a location where you want to install the Android NDK and run:

curl https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip -o ndk.zip

unzip ndk.zip

It will create a android-ndk-r15c folder. Save that path for later.

Prerequisites to build the Android library on Mac OS:

Git:

Run git in a terminal window, it will show a prompt to install it if not already present.

As an alternative, installing one of these will install git:

XCode, with the Command Line Tools.

Install Android NDK r15c for Mac OS:

Choose a location where you want to install the Android NDK and run:

curl https://dl.google.com/android/repository/android-ndk-r15c-darwin-x86_64.zip -o ndk.zip

unzip ndk.zip

It will create a android-ndk-r15c folder. Save that path for later.

Building the Android library on Linux or Mac OS:

1) Clone this repo and check out the mobile-master branch:

git clone https://github.com/janeasystems/nodejs-mobile

cd nodejs-mobile

git checkout mobile-master

2a) Using the Android helper script:

The tools/android_build.sh script takes as first argument the Android NDK path (in our case is ~/android-ndk-r15c). The second argument is optional and is the target architecture, by default is arm.

Run:

./tools/android_build.sh ~/android-ndk-r15c

When done, the built shared library will be placed in out_android/arm/libnode.so.

2b) Configure and build manually:

Run the android-configure script to configure the build with the path to the downloaded NDK and the desired target architecture.

source ./android-configure ../android-ndk-r15c arm

Start the build phase:

make

This will create the Android armeabi-v7a shared library in out/Release/lib.target/libnode.so.

Contributing

Please see the CONTRIBUTING file in the doc_mobile folder in this source distribution.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值