简体   繁体   中英

Launch ADB command from PHP with script shell

I'm coding a web app which allows users to install android application on their android smartphone (plug with USB).

There is my PHP script (running in localhost with MAMP server) :

echo exec('./myscript.sh '.$apkName);

And there is my shell script :

#!/bin/bash 
echo test
adb install ./$1

But I think, there is a right problem to execute adb command, that I don't understand, because I set the adb in chmod 777...

The command line 'echo test' workd perfectly but not the adb command.

Could you enlight me for this problem ?

Thanks in advance !

尝试adb -d install <My APK Path>/<My APK Name>.apk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM