Skip to content

适配设备端 u2.apk 0.5.0,输入法改由 u2.apk 内置提供 - #1203

Open
codeskyblue wants to merge 1 commit into
masterfrom
chore/20261103-u2-apk-server
Open

codeskyblue wants to merge 1 commit into
masterfrom
chore/20261103-u2-apk-server

Conversation

@codeskyblue

Copy link
Copy Markdown
Member

No description provided.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 02:28
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.32%. Comparing base (5d373ad) to head (a1bc87d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
uiautomator2/__main__.py 0.00% 11 Missing ⚠️
uiautomator2/core.py 18.18% 9 Missing ⚠️
uiautomator2/_input.py 28.57% 4 Missing and 1 partial ⚠️
uiautomator2/__init__.py 0.00% 2 Missing ⚠️
uiautomator2/version.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1203      +/-   ##
==========================================
+ Coverage   45.31%   45.32%   +0.01%     
==========================================
  Files          29       29              
  Lines        4162     4163       +1     
  Branches      813      812       -1     
==========================================
+ Hits         1886     1887       +1     
+ Misses       2164     2163       -1     
- Partials      112      113       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new IME-discovery/reinstallation path lacks regression coverage because the shell mock cannot distinguish installed from selected keyboards, leaving stale-default and installed-but-unselected scenarios untested.

1 open issue
What changed in this PR

Migrates the Python client to device-side u2.apk 0.5.0, which provides both the automation server and the bundled keyboard.

Changes:

  • Replaces separate JAR and keyboard APK handling with unified APK synchronization, setup, and cleanup.
  • Updates keyboard discovery, protects the new package during bulk app operations, and documents Android 5.0+ support.
  • Adds end-to-end tests and fixtures, updates asset references, and points make test to e2e_tests/.
File Description
uiautomator2/​version.py Defines the unified server version.
uiautomator2/​core.py Pushes and launches u2.apk; retains the setup alias.
uiautomator2/​assets/​sync.sh Downloads the unified APK and records its version.
uiautomator2/​_input.py Uses the bundled keyboard and checks installation before selection.
uiautomator2/​__main__.py Updates initialization, purge, and asset export.
uiautomator2/​__init__.py Protects the new package during bulk app operations.
tests/​test_input.py Updates the mocked keyboard identifier.
tests/​test_core.py Updates hash-check tests to APK paths.
README.md Documents the APK, Android minimum, and keyboard identifier.
README_CN.md Updates Android requirements and the keyboard comment.
Makefile Targets the end-to-end test directory.
e2e_tests/​testdata/​AE86.jpg Adds an image-test fixture.
e2e_tests/​test_xpath.py Adds XPath interaction tests.
e2e_tests/​test_watcher.py Adds a watcher-context test.
e2e_tests/​test_swipe.py Adds swipe-duration verification.
e2e_tests/​test_simple.py Adds basic interaction tests and skipped legacy cases.
e2e_tests/​test_settings.py Waits for the target before measuring operation delays.
e2e_tests/​test_session.py Adds session and app-lifecycle tests.
e2e_tests/​test_screenrecord.py Adds a skipped legacy recording test.
e2e_tests/​test_push_pull.py Adds file-transfer verification.
e2e_tests/​skip_test_image.py Adds image tests outside default test discovery.
e2e_tests/​runtest.sh Adds an ApiDemos installation and test runner script.
e2e_tests/​conftest.py Provides shared device and app fixtures.
docs/​2to3.md Updates keyboard identifiers in migration examples.
demo_tests/​test_core.py Uses the APK path in server-recovery testing.
.github/​copilot-instructions.md Updates asset and test-directory guidance.

Review effort: Balanced

Comment thread uiautomator2/_input.py
Comment on lines +54 to +58
ime_list = self.__get_ime_list()
if self.__ime_id not in ime_list:
# default_input_method may keep a stale value after the apk is
# uninstalled or upgraded, so always verify the ime is installed.
self._setup_ime()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants