查看cpu数量
log(shell('cat /proc/cpuinfo | grep "processor"|wc -l').result);
显示当前进程的状态
C:\Users\Administrator>adb shell mars:/ $ ps -e | grep node root 1 0 2200952 4368 0 0 S init root 800 1 5507728 49276 0 0 S zygote64 u0_a343 28221 800 40742856 283908 0 0 S org.autojs.autojspro:script u0_a343 28500 28221 2130836 2712 0 0 S sh u0_a343 28502 28500 2443060 36084 0 0 S node
查看当前系统环境变量
cmd = "printenv"; var result = shell(cmd); log(result); if (result.code == 0) { toast("执行成功"); } else { toast("执行失败!请到控制台查看错误信息"); }
_=/system/bin/printenv ANDROID_DATA=/data NPM_PREFIX=/data/user/0/org.autojs.autojspro/files/termux/usr/bin DOWNLOAD_CACHE=/data/cache ANDROID_SOCKET_usap_pool_primary=22 DEX2OATBOOTCLASSPATH=/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/core-icu4j.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/miuisdk@boot.jar:/system/framework/miuisystemsdk@boot.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/framework-atb-backward-compatibility.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar ANDROID_TZDATA_ROOT=/apex/com.android.tzdata ANDROID_SOCKET_zygote=18 ANDROID_ROOT=/system ANDROID_BOOTLOGO=1 ANDROID_ASSETS=/system/app BOOTCLASSPATH=/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/core-icu4j.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/miuisdk@boot.jar:/system/framework/miuisystemsdk@boot.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/framework-atb-backward-compatibility.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.wifi/javalib/framework-wifi.jar:/apex/com.android.tethering/javalib/framework-tethering.jar EXTERNAL_STORAGE=/sdcard ANDROID_ART_ROOT=/apex/com.android.art ANDROID_STORAGE=/storage PATH=/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:/data/app/~~1Tk_g6l0BKKyMSNeSAAUrA==/org.autojs.autojspro-3V4XKtswALoVldxrBK29fg==/lib/arm64 LD_LIBRARY_PATH=/data/app/~~1Tk_g6l0BKKyMSNeSAAUrA==/org.autojs.autojspro-3V4XKtswALoVldxrBK29fg==/lib/arm64 SYSTEMSERVERCLASSPATH=/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/apex/com.android.permission/javalib/service-permission.jar:/apex/com.android.wifi/javalib/service-wifi.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar ASEC_MOUNTPOINT=/mnt/asec ANDROID_I18N_ROOT=/apex/com.android.i18n
修改PATH
cmd = "export PATH=$PATH:/storage/emulated/0/脚本/ft/ft/node_modules/pm2/bin && echo $PATH && pm2 --help"; var result = shell(cmd); log(result);
查看node安装到哪里了
npm config ls
名人名言
思路是最重要的, 其他的百度, bing, stackoverflow, 安卓文档, autojs文档, 最后才是群里问问
--- 牙叔教程
声明
部分内容来自网络
本教程仅用于学习, 禁止用于其他用途