安装开箱即用的auto.pro的npm扩展包,让你轻松开发复杂 auto 应用,有视频教程

简介

开箱即用的 auto.pro 的 npm 扩展包,提供了一个 cli 工具来创建模板项目,让你轻松开发复杂 auto 应用。可配置 webpack、babel、ts、es6、压缩混淆、AES 加密,大家可以使用完整的 JS 新特性来写 auto 应用啦。

包名 版本 描述
@auto.pro/cli cli 工具,可用于下载模板,以及将 js 转换为 dex
@auto.pro/core 框架核心,提供应用和其他插件所需的各种属性、服务、权限
@auto.pro/action 动作插件,兼容高低安卓版本的点击、滑动等功能,配有贝塞尔函数等
@auto.pro/search 图色插件,封装了分辨率适配、循环找图、缓存及其他增强型函数
@auto.pro/stream 流程插件,提供了 RxJS 拓展操作符,便于检验和重做失效操作
@auto.pro/webview 网页插件,可使用 html 作为 UI 界面,有便捷的双向通信功能
@auto.pro/floaty 悬浮窗插件,快速创建悬浮窗,能拖动和切换,支持多个自定义按钮

本项目能做什么

  • 使用完善的 js、ts 语法特性
  • 框架级的应用设计
  • 将多个 JS 打包成单文件
  • 将 JS 进行混淆、加密、dex 化
  • 加载各种 npm 包,使 babel 等编译工具支持 auto 语法
  • 使用集成的 auto 模块
  • 使用 html 网页作为 UI

项目

项目地址

wiki 文档

安装Node.js

进入Node.js官方网站,选择14.5.0LTS版本下载

file

下载完成后,一路点击下一步/继续
file

node和npm都已安装完成
file

打开终端,分两次输入如下命令,检查版本号

npm -v
node -v

出现以下信息,说明安装成功
file

安装nrm加速工具

项目地址

// 全局安装nrm工具
npm i -g nrm
// 查看源列表
nrm ls
// 使用nrm将镜像源切换到淘宝源
nrm use taobao

file

在切换源的时候,可能会出现报错:command not found: nrm
出现这个问题,百度上有多种原因和解决办法。
测试了几个都不行,后来按照其中一个方法,顺利解决了。

查看npm的安装目录,需要输入Mac系统密码

npm root

如果不是/usr/local , 说明未全局安装,执行

sudo npm config set prefix /usr/local

再按1查看npm的安装路径,如果是usr/local,则可以顺利安装gulp

sudo npm install -g nrm

运行过程如下:

feiyun@FeiYun-Mac ~ % npm root
/Users/feiyun/node_modules
feiyun@FeiYun-Mac ~ % sudo npm config set prefix /usr/local
Password:
feiyun@FeiYun-Mac ~ % sudo npm install -g nrm
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated coffee-script@1.7.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/nrm -> /usr/local/lib/node_modules/nrm/cli.js
+ nrm@1.2.1
added 493 packages from 892 contributors in 10.417s
feiyun@FeiYun-Mac ~ % nrm ls

* npm -------- https://registry.npmjs.org/
  yarn ------- https://registry.yarnpkg.com/
  cnpm ------- http://r.cnpmjs.org/
  taobao ----- https://registry.npm.taobao.org/
  nj --------- https://registry.nodejitsu.com/
  npmMirror -- https://skimdb.npmjs.com/registry/
  edunpm ----- http://registry.enpmjs.org/

feiyun@FeiYun-Mac ~ % nrm use taobao

   Registry has been set to: https://registry.npm.taobao.org/

feiyun@FeiYun-Mac ~ % 

全局安装最新版cli工具

如需将js文件转换为dex文件,需全局安装cli工具

npm i "@auto.pro/cli" -g

安装过程如下:

feiyun@FeiYun-Mac ~ % npm i "@auto.pro/cli" -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/feiyun/.npm/_logs/2020-11-12T08_42_33_750Z-debug.log
feiyun@FeiYun-Mac ~ % 

permission denied错误处理

处理方法请参考视频教程。

已有0人支付

再次全局安装cli,过程如下


feiyun@FeiYun-Mac ~ % npm i "@auto.pro/cli" -g
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@auto.pro/cli/lib/cli.js
npm ERR! dest /usr/local/bin/auto-cli
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/@auto.pro/cli/lib/cli.js' -> '/usr/local/bin/auto-cli'
npm ERR!  [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/@auto.pro/cli/lib/cli.js' -> '/usr/local/bin/auto-cli'] {
npm ERR!   cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/@auto.pro/cli/lib/cli.js' -> '/usr/local/bin/auto-cli'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'symlink',
npm ERR!     path: '../lib/node_modules/@auto.pro/cli/lib/cli.js',
npm ERR!     dest: '/usr/local/bin/auto-cli'
npm ERR!   },
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/@auto.pro/cli/lib/cli.js',
npm ERR!   dest: '/usr/local/bin/auto-cli'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/feiyun/.npm/_logs/2020-11-12T09_02_58_823Z-debug.log
feiyun@FeiYun-Mac ~ % sudo chmod -R 777 /usr/local/bin/auto-cli
chmod: /usr/local/bin/auto-cli: No such file or directory

执行sudo chmod -R 777 /usr/local/bin/auto-cli命令,提示No such file or directory。
遇到这种问题,可以尝试执行上一级目录。

sudo chmod -R 777 /usr/local/bin

执行完成后,再次全局安装cli工具。安装过程如下:

feiyun@FeiYun-Mac ~ % sudo chmod -R 777 /usr/local/bin/auto-cli
chmod: /usr/local/bin/auto-cli: No such file or directory
feiyun@FeiYun-Mac ~ % sudo chmod -R 777 /usr/local/bin
feiyun@FeiYun-Mac ~ % npm i "@auto.pro/cli" -g
/usr/local/bin/auto-cli -> /usr/local/lib/node_modules/@auto.pro/cli/lib/cli.js
+ @auto.pro/cli@9.0.1
added 176 packages from 91 contributors in 11.212s
feiyun@FeiYun-Mac ~ % 

这次没有报错。说明系统已经全局安装了cli工具。

1. 官方交流QQ群,添加多个不批。建议使用安卓手机或电脑申请。
Auto.js学习交流③群:286635606
Auto.js学习交流②群:712194666(满员)
IOS免越狱自动化测试群:691997586
EasyClick学习交流①群:737066890
2. 盗版,破解有损他人权益和违法作为,请各位会员支持正版。
3. 本站部分资源来源于用户上传和网络搜集,如有侵权请提供版权证明并联系站长删除。
4.如未特别申明,本站的技术性文章均为原创,未经授权,禁止转载/搬运等侵权行为。
5.全站所有付费服务均为虚拟商品,购买后自动发货。售出后概不接受任何理由的退、换。注册即为接受此条款。
6.如果站内内容侵犯了您的权益,请联系站长删除。
飞云脚本 » 安装开箱即用的auto.pro的npm扩展包,让你轻松开发复杂 auto 应用,有视频教程

企业级大数据智能营销管理系统

了解详情