0

I have an APK file and i have a 4GB usb stick that could be plugged into an Android phone via USB-OTG and a PC. I've been wondering how could i plug the usb into the android phone and have the apk be auto installed without doing it manually. I'm asking for something like the autorun script we use on PC but I need one for android. I'm interested in having it work on Lollipop in particular, if that makes a difference.

photo of USB storage

3

It's not possible to install packages automatically, and there's no feature like AutoRun. AutoRun was a huge security problem on Windows systems, so it seems unlikely that a similar feature will be added to Android. You just have to put the APK file on the USB stick and install it by opening it with the package installer.

It would be possible to make an app that listens for USB connection events, scans for APK files, and asks the package installer to install any APK files it finds, but the app would have to be already installed on the phone, and the user would still have to click to accept the installation of the new apps.

  • I heard something about the manifest file that could be altered to add an autorun but im not sure about this – Mhmd Joudi Apr 19 '17 at 11:34
  • @MhmdJoudi It is not possible, Dan's answer is correct... Having that capability would a massive security hole in Android. – acejavelin Apr 19 '17 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.