Python ile farklı uygulamayı çalıştırma

Merhaba, android telefonda python kullanarak farklı bir uygulamayı çalıştırmak için hangi kodu kullanmam gerekiyor ? Teşekkürler

asagidaki cumleden kastinizin pc uzerinde calisan bir python scriptinden android uygulamasi calistirmak oldugunu anladim

soyle bir paket mevcut bununla adb shell komutlarini python scriptinizde kullanabilirsiniz mesela uygulama calistiracaksiniz

from adb_shell.adb_device import AdbDeviceTcp, AdbDeviceUsb
from adb_shell.auth.sign_pythonrsa import PythonRSASigner

# Load the public and private keys
adbkey = 'path/to/adbkey'
with open(adbkey) as f:
    priv = f.read()
 with open(adbkey + '.pub') as f:
     pub = f.read()
signer = PythonRSASigner(pub, priv)

# Connect
device1 = AdbDeviceTcp('192.168.0.222', 5555, default_transport_timeout_s=9.)
device1.connect(rsa_keys=[signer], auth_timeout_s=0.1)

# Connect via USB (package must be installed via `pip install adb-shell[usb])`
device2 = AdbDeviceUsb()
device2.connect(rsa_keys=[signer], auth_timeout_s=0.1)

# Send a shell command
response1 = device1.shell('adb shell am start -n com.package.name/com.package.name.ActivityName')

1 Beğeni

Çok teşekkür ederim👍🏻