Catalog PyPI
Back to packageRELEASE DETAILS

0.12

PyPI

adbeasykey

handles spaces, accents and other sneaky characters in ADB commands

adbandroidinputkeyeventtext
Published12 Oct 2023
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.12 documentation

handles spaces, accents and other sneaky characters in ADB commands

Tested against Windows / Python 3.11 / Anaconda

pip install adbeasykey


from adbeasykey import AdbEasyKey
adbpath = r"C:\Android\android-sdk\platform-tools\adb.exe"
serial_number = "127.0.0.1:5555"
adb = AdbEasyKey(adbpath, serial_number, use_busybox=False) # if use_busybox is True, busybox will be used to decode the base64-encoded command
adb.connect_to_device_ps()
adb.connect_to_device_subprocess()
text = f'"it\'s me", he said then he went away "Montréal, über, 12.89, Mère, Françoise, noël, 889 groß"""'
adb.install_adb_keyboard()
adb.input_text_adb_keyboard_ps(
    text, change_back=True, sleeptime=(0, 0), add_exit=True
)  # preserves accents - suffix _ps is for use Windows Powershell
adb.input_text_adb_keyboard_subprocess(
    text, change_back=True, sleeptime=(0.1, 0.2), add_exit=True
)  # preserves accents
adb.keyevents.KEYCODE_A.press_ps()
adb.keyevents.KEYCODE_A.press_subproc()
adb.keyevents.KEYCODE_A.longpress_subproc()
adb.keyevents.KEYCODE_A.longpress_ps()
adb.input_text_ps(text)  # doesn't preserve accents
adb.input_text_ps(text, remove_accents=True)  # ç -> c
adb.input_text_ps(text, sleeptime=(0.1, 0.2), remove_accents=True) # one by one
adb.input_text_ps(text, sleeptime=(0.1, 0.2), remove_accents=True, input_device='keyboard') 
adb.keyevents.KEYCODE_A.longpress_ps.gamepad()
adb.keyevents.KEYCODE_A.longpress_ps.keyboard()
adb.input_text_subprocess(text)  # doesn't preserve accents
adb.input_text_subprocess(text, remove_accents=True)  # ç -> c
adb.input_text_subprocess(text, sleeptime=(0.1, 0.2), remove_accents=True)
stdout, stderr = adb.adb_shell_ps("ls / -1 -R -i -H -las")
stdout, stderr = adb.adb_shell_ps("ls /data")  # no permission
stdout, stderr = adb.adb_shell_ps("ls /data", su=True)  # permission
stdout, stderr = adb.adb_shell_ps('mkdir "/sdcard/bub ö äß"')
stdout, stderr = adb.adb_shell_ps("ls /sdcard/")
stdout, stderr = adb.adb_shell_subprocess("ls / -1 -R -i -H -las")
stdout, stderr = adb.adb_shell_subprocess("ls /data")  # no permission
stdout, stderr = adb.adb_shell_subprocess("ls /data", su=True)  # permission
stdout, stderr = adb.adb_shell_subprocess('mkdir "/sdcard/#gx bub ö äß"')
stdout, stderr = adb.adb_shell_subprocess("ls /sdcard/")
stdout, stderr = adb.adb_ps(
    cmd=r"push C:\Users\hansc\Downloads\Roger LeRoy Miller, Daniel K. Benjamin, Douglass C. North - The Economics of Public Issues-Pearson College Div (2017).pdf /sdcard/Download/testbba.pdf"
)
stdout, stderr = adb.adb_subprocess(
    cmd=r"push C:\Users\hansc\Downloads\Roger LeRoy Miller, Daniel K. Benjamin, Douglass C. North - The Economics of Public Issues-Pearson College Div (2017).pdf /sdcard/Download/testbba.pdf"
)

stdout, stderr = adb.adb_shell_ps(
    "input swipe 600 600 0 0 1000\ninput swipe 0 0 600 600 1000",
)
adb.is_keyboard_shown()
adb.get_active_keyboard()
adb.change_to_adb_keyboard()
adb.change_keyboard(
    keyboard="com.android.inputmethod.latin/.LatinIME",
)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
detachedproc
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
detachedprocruntime
fullpath83replace
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
fullpath83replaceruntime
kthread
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
kthreadruntime
kthread-sleep
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
kthread-sleepruntime
normaltext
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
normaltextruntime
punktdict
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
punktdictruntime
requests
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
requestsruntime

Distribution files

2 collected
adbeasykey-0.12-py3-none-any.whl

bdist_wheel · 26.41 KB · Python py3

Source file
adbeasykey-0.12.tar.gz

sdist · 25.98 KB · Python source

Source file

Repository

PENDING
hansalemaos/adbeasykey

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:54ee3252dd87a555f99ff28a366e4279d8cb461cfd3928425f7a55a1365bfb68

Other collected versions

View all collected versions →