如何离线安装SL4A解释器
在我目前的工作中,我对 perl/python/lua 上的 android 脚本非常感兴趣,但我的流量消耗也非常有限,并且在重新刷新 android 设备后我可能需要经常重复解释器安装过程。那么有没有办法在没有互联网连接的情况下使用准备好的文件/档案在 SL4A 中安装解释器呢?
I'm really interested in android scripting on perl/python/lua at my current job, but I'm also very limited in traffic consumption and I may need frequently repeat interpreters install procedure after reflashing android devices. So is there any way to install interpreters in SL4A using prepared files/archives without internet connection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了安装 Py4a,我最终修改了
android/PythonForAndroid/src/com/googlecode/pythonforandroid/PythonDescriptor.java
,将其中的BASE_URL
更改为file:// /
网址。然后,我能够将adb push
python_*.zip
文件放入该目录,并从那里安装。关键是要注意
logcat
错误消息。由于我没有版本文件,代码始终要求_r1.zip
。应用以下补丁,然后按照 Py4A 的 README 文件中的说明构建 APK。
获得
.apk
后,继续安装所有内容:最后一步是启动 Py4A,然后点击
Install
。For installing Py4a, I ended up modifying
android/PythonForAndroid/src/com/googlecode/pythonforandroid/PythonDescriptor.java
, changingBASE_URL
there into afile:///
URL. I was then able toadb push
thepython_*.zip
files into that directory, and install from there.A key was paying attention to the
logcat
error messages. As I had no version files, the code asked for an_r1.zip
always.Apply the following patch, and then just follow the instructions in the
README
file of Py4A to build the APK.Once you have the
.apk
, go ahead and install everything:The final step is to launch Py4A, and poke
Install
.我发现的简单方法是以在线模式安装所有内容一次,然后压缩目录的内容:
并使用以下批处理脚本进行任何后续安装(Windows)
The straightforward way that I found is to install everything in online mode once, then compress the contents of directories:
And make any subsequent install using following batch script (Windows)