原生 IOS 应用程序和 node.js
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10463121/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Native IOS app and node.js
提问by Hello World
Is it possible to create a native ios app with node.js, and is so does anyone have any examples?
是否可以使用 node.js 创建本机 ios 应用程序,是否有人有任何示例?
回答by electblake
I search for this constantly, and although many of these answers are quite right in citing that V8 isn't iOS compatible, it seems that running a nodelike environment within iOS isn't all that impossible.
我一直在寻找这个,虽然这些答案中的许多都非常正确地指出 V8 与 iOS 不兼容,但似乎在 iOS 中运行类似节点的环境并非完全不可能。
The first option I discovered was called "Neunode" (hasn't been updated in a year). Here are some reference links if you want more:
我发现的第一个选项叫做“Neunode”(一年没有更新)。如果您想要更多,这里有一些参考链接:
- https://github.com/snakajima/neunode
- http://www.neunode.com
- https://www.youtube.com/watch?v=xzFH80-HYTo(httpserver example)
- https://github.com/snakajima/neunode
- http://www.neunode.com
- https://www.youtube.com/watch?v=xzFH80-HYTo(httpserver示例)
Nodelike / Node.app Project
Nodelike / Node.app 项目
Nodelike is the core framework of the Node.app project, which has the goal to implement a roughly Node.JS-compatible interface using JavaScriptCore.framework on iOS 7 and OS X Mavericks.
Nodelike 是 Node.app 项目的核心框架,其目标是在 iOS 7 和 OS X Mavericks 上使用 JavaScriptCore.framework 实现大致与 Node.JS 兼容的接口。
Example: Interpreter
示例:口译员
an example project implementing a Node.JS interpreter as an iOS app, utilising the Nodelike framework.
使用 Nodelike 框架将 Node.JS 解释器实现为 iOS 应用程序的示例项目。
Edit:
编辑:
It is still "not viable for serious projects" but checkout updates at: https://github.com/node-app/Nodelike
它仍然“不适用于严肃的项目”,但在以下位置签出更新:https: //github.com/node-app/Nodelike
Overall, The Node.app Project looks promising, be sure to checkout their website
总的来说,Node.app 项目看起来很有前途,一定要查看他们的网站
回答by Nuray Altin
Yes!You can run Node applications on iOS devices. Node.JS fork JXcorehas implemented SpiderMonkey JavaScript engine in addition to Google's V8. The source code repository is available from Github
是的!您可以在 iOS 设备上运行 Node 应用程序。Node.JS fork除了谷歌的 V8 之外,JXcore还实现了 SpiderMonkey JavaScript 引擎。源代码存储库可从Github 获得
回答by K2xL
No. But you can write native applications in Javascript (which is the same language as Node - which is server run javascript) by using a tool like Unity.
不是。但是您可以使用 Unity 之类的工具以 Javascript(与 Node 相同的语言,即服务器运行的 javascript)编写本机应用程序。
Also, welcome to SO!
另外,欢迎来到 SO!
回答by Hyman
No you can't create a native iOS app using Node.js. Unless you find a means of installing Node.js, which would be very custom and would require rooting the phone.
不,您不能使用 Node.js 创建本机 iOS 应用程序。除非你找到了一种安装 Node.js 的方法,这将是非常定制的并且需要 root 手机。
May I ask what you're trying to achieve? I could point you in the right direction. Unless you're just curious as to whether Node would work on iOS.
我可以问你想要达到什么目标吗?我可以为你指明正确的方向。除非你只是好奇 Node 是否可以在 iOS 上运行。
回答by Sam Rijs
There is a relatively new project trying to archive this: http://nodeapp.org/
有一个相对较新的项目试图对此进行存档:http: //nodeapp.org/
It is under active development and already supports most basic stuff and filesystem access.
它正在积极开发中,并且已经支持最基本的东西和文件系统访问。
回答by infografnet
As Nuray Altin have mentioned, you can do it with JXcoreand its plugin for Cordova. Here is an article on that subject: Develop an iOS Application with Node.js and Cordova.
正如 Nuray Altin 所提到的,您可以使用JXcore及其Cordova 插件来实现。这是关于该主题的文章:使用 Node.js 和 Cordova 开发 iOS 应用程序。
It goes step by step through the process (compiling JXcore from sources, installing Apache Cordova, creating an app etc.)
它逐步完成整个过程(从源代码编译 JXcore、安装 Apache Cordova、创建应用程序等)
回答by nickshoe
You can't run a proper Node.js environment inside a native iOS App, due to sandbox limitations.
由于沙盒限制,您无法在原生 iOS 应用程序中运行适当的 Node.js 环境。
Having said that, there are several projects that enable you tu embed/run Node.js applications inside a native (iOS/Android) App.
话虽如此,有几个项目可以让您在本机(iOS/Android)应用程序中嵌入/运行 Node.js 应用程序。
This is maybe the most popular project: http://jxcore.io/
这可能是最受欢迎的项目:http: //jxcore.io/
This is a sample iOS project that use JXcore: https://github.com/jxcore/jxcore-ios-sample
这是一个使用 JXcore 的示例 iOS 项目:https: //github.com/jxcore/jxcore-ios-sample
回答by Trevor
I should mention you can compile node.js into an arm-emu-arm mode and it runs on iOS without issue. It could "hypothetically" be accepted by Apple's app store, but there's several hundreds of reasons why no person (let alone app store) would accept a node app yet.
我应该提到你可以将 node.js 编译成 arm-emu-arm 模式,它在 iOS 上运行没有问题。它可以“假设”被 Apple 的应用程序商店接受,但是有数百个原因为什么没有人(更不用说应用程序商店)会接受节点应用程序。