3

Is there a way to programmatically install an Android .apk in Python?

Could you please show me how? I'm new to Python.

Thanks in advance.

92AlanC
  • 1,327
  • 2
  • 14
  • 33

2 Answers2

1

As @Swing mentioned in his comment, subprocess.call("adb install path-to-file.apk ") solves the issue.

92AlanC
  • 1,327
  • 2
  • 14
  • 33
0

I have designed a python script to automate download of apk files and reinstall them. I have coded a wrapper/adapter of the ADB process in python by using:

subprocess.run()

Public repo is Xackage there: Xackage on GitHub

I did also a Youtube video where I use Xackage to automate the pull of all ThirdParty Apk, before making a factory reset and re pushing all of them.
https://www.youtube.com/watch?v=UT4ZoD5rI2U

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Thierry Brémard
  • 625
  • 1
  • 5
  • 14