学习appium源码中,遇到的nodejs问题
http://m.blog.csdn.net/blog/mentgmery1/41645427
1.path.resolve
相当于不断的做cd命令
http://haiyupeter.iteye.com/blog/1733260
2.prototype
在node.js中User.prototype.save = function(){…}和User.save = function(){…}有什么区别呢?
就是实例函数和类函数的区别。。。
User.save = function(){......} 是这样调用的:User.save()
User.prototype.save = function(){.......} 是这样调用的:
var user = new User();
user.save();
3.plist
Property List,属性列表文件,它是一种用来存储串行化后的对象的文件。属性列表文件的扩展名为.plist ,因此通常被称为 plist文件。文件是xml格式的。
Plist文件通常用于储存用户设置,也可以用于存储捆绑的信息
http://blog.csdn.net/totogo2010/article/details/7634185
4.xcodebuild && xcrun
打包过程
xcodebuild负责将工程源文件编译成xxx.app
xcrun负责给xxx.app(签名并)打包成xxx.ipa
http://blog.csdn.net/totogo2010/article/details/8883100
5.node-idevice & ideviceinstaller
node-idevice 使用node将app安装到iOS设备上,依赖于ideviceinstaller
可以安装,卸载等等
安装app的第三方工具
6.common.js -> proxy
this.push([command, cb]);
将command push到appium工作队列中
7.friutstrap
命令行工具,使用私有MobileDevice API将iOS应用安装到物理机器上。
8.instruments
instruments path:xcrun -find instruments 获取instruments路径
instruments无法将app自动安装到device上,需要使用xcode build,因此需要app bundle的绝对路径
http://stackoverflow.com/questions/15410465/start-instruments-from-the-command-line
9.__dirname
module.filename:开发期间,该行代码所在的文件。
__filename:始终等于 module.filename。
__dirname:开发期间,该行代码所在的目录。
process.cwd():运行node的工作目录,可以使用 cd /d 修改工作目录。
require.main.filename:用node命令启动的module的filename, 如 node xxx,这里的filename就是这个xxx。
10.cd
cd 进入用户主目录;
cd ~ 进入用户主目录;
cd - 返回进入此目录之前所在的目录;
cd .. 返回上级目录(若当前目录为“/“,则执行完后还在“/";".."为上级目录的意思);
cd ../.. 返回上两级目录;
cd !$ 把上个命令的参数作为cd参数使用。
11.underscore
Underscore为我们提供了这样的一个实用工具包。比如,HashMap,面向对象式编程如何实现继承,如何实现通用的iterator对集合对象做遍历,如何对Array实现快速排序。
http://blog.fens.me/nodejs-underscore/
12.express
http://javascript.ruanyifeng.com/nodejs/express.html#toc7
13.domain
异常处理,由于nodejs的回调异步特性,nodejs无法使用try catch捕捉一场
http://deadhorse.me/nodejs/2013/04/13/exception_and_domain.html
14.async
nodejs是异步调用模型,同步很容易做到的事情,nodejs很难实现
async是解决流程控制的较好方案
(1)多个函数,顺序执行,彼此之间无数据交换 async.series
http://blog.csdn.net/henren555/article/details/38734653
http://blog.csdn.net/zhubaitian/article/details/40710049
http://blog.csdn.net/zhubaitian/article/details/40783625