SL4A/Py4A直接在adb中用python加载脚本

lyj posted @ 2014年3月24日 22:06 in Android , 1550 阅读

在PC上执行adb shell,但是python由于环境变量问题不可以直接在adb的shell中调用。

/etc/profile

mount -t tmpfs tmpfs /data/tmp
chmod 1777 /data/tmp

export EXTERNAL_STORAGE=/mnt/sdcard
PYTHONPATH=/mnt/sdcard/com.googlecode.pythonforandroid/extras/python
PYTHONPATH=${PYTHONPATH}:/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6/lib-dynload
export PYTHONPATH
export TEMP=/data/tmp
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=/data/data/com.googlecode.pythonforandroid/files/python
export LD_LIBRARY_PATH=/data/data/com.googlecode.pythonforandroid/files/python/lib

然后在/sbin下建个软连接到/data/data/com.googlecode.pythonforandroid/files/python/bin/python即可

 

ln -s /data/data/com.googlecode.pythonforandroid/files/python/bin/python /sbin/python

 最后,手机上开启Script Monitor Service

SL4A->Menu->View->Interpreters,  Menu->Starft Server->Private

后来找到官网有详细教程,如下。

https://code.google.com/p/android-scripting/wiki/RemoteControl
Avatar_small
NCERT Evs Sample Pap 说:
2022年9月16日 05:27

GK stands for General knowledge which was introduced as one of the subjects. It is beginning from the foundation education to help the students by getting minimum knowledge. GK also play a key role in competitive examinations, NCERT GK Sample Paper Class 2 that’s the way NCERT included General knowledge is a subject that everyone should know and learn from Primary Education.Downloading NCERT GK Sample Paper 2023 Class 2 utilizes candidates who have to know the new examination pattern and want to get high scores smoothly for all formats of exams conducted in Term-1, Term-2 such as SA-1, SA-2, FA-1, FA-2, FA-3, FA-4, Assignments and other types of exams to Hindi Medium, English medium and Urdu Medium students.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter