appium / appium-espresso-driver

Espresso integration for Appium
Apache License 2.0
191 stars 75 forks source link

Sometimes? "shell ime enable io.appium.settings/.UnicodeIME" fails on Android 13 beta #790

Open KazuCocoa opened 2 years ago

KazuCocoa commented 2 years ago

I saw /Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime enable io.appium.settings/.UnicodeIME raised an error as below in Android 13 beta emulator. The command itself succeeded, but it seems like the initial time? or something failed once?

[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop persist.sys.locale'
[debug] [ADB] Current device property 'persist.sys.locale':
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.locale'
[debug] [ADB] Current device property 'ro.product.locale': en-US
[debug] [ADB] Current locale: 'en-US'; requested locale: 'en-US'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop persist.sys.locale'
[debug] [ADB] Current device property 'persist.sys.locale':
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.locale'
[debug] [ADB] Current device property 'ro.product.locale': en-US
[debug] [ADB] Requested locale is equal to current locale: 'en-us'
[debug] [Logcat] Starting logs capture with command: /Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 logcat -v threadtime
[debug] [AndroidDriver] Enabling Unicode keyboard support
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get secure default_input_method'
[debug] [AndroidDriver] Unsetting previous IME com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
[debug] [AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime enable io.appium.settings/.UnicodeIME'
[debug] [EspressoDriver@142c (10970321)] Deleting espresso session
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.android.apis'
[debug] [Logcat] Stopping logcat capture
[EspressoDriver@142c (10970321)] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8200'
[EspressoDriver@142c] Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Command output: adb: error: listener 'tcp:8200' not found
[EspressoDriver@142c] '
[debug] [AppiumDriver@6009] Event 'newSessionStarted' logged at 1654964517548 (09:21:57 GMT-0700 (Pacific Daylight Time))
[debug] [AppiumDriver@6009] Encountered internal error running command: A new session could not be created. Details: Error executing adbExec. Original error: 'Command '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime enable io.appium.settings/.UnicodeIME' exited with code 255'; Command output: Unknown input method io.appium.settings/.UnicodeIME cannot be enabled for user #0
[debug] [AppiumDriver@6009] . Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [AppiumDriver@6009] Error: Command '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime enable io.appium.settings/.UnicodeIME' exited with code 255
[debug] [AppiumDriver@6009]     at ChildProcess.<anonymous> (/Users/kazuaki/.appium/node_modules/appium-espresso-driver/node_modules/teen_process/lib/exec.js:113:19)
[debug] [AppiumDriver@6009]     at ChildProcess.emit (events.js:400:28)
[debug] [AppiumDriver@6009]     at maybeClose (internal/child_process.js:1058:16)
[debug] [AppiumDriver@6009]     at Socket.<anonymous> (internal/child_process.js:443:11)
[debug] [AppiumDriver@6009]     at Socket.emit (events.js:400:28)
[debug] [AppiumDriver@6009]     at Pipe.<anonymous> (net.js:686:12)
[HTTP] <-- POST /wd/hub/session 500 4639 ms - 1085
[HTTP]
KazuCocoa commented 2 years ago

Ok case:

[debug] [AndroidDriver] Unsetting previous IME com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
[debug] [AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime enable io.appium.settings/.UnicodeIME'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell ime set io.appium.settings/.UnicodeIME'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global animator_duration_scale'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global transition_animation_scale'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell settings get global window_animation_scale'
[debug] [ADB] Running '/Users/kazuaki/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am broadcast -a io.appium.settings.animation -n io.appium.settings/.receivers.AnimationSettingReceiver --es setstatus disable'
KazuCocoa commented 2 years ago

Potentially we need to enable the IME by manual once by some security restriction. Still beta, so let's see how this will be in next beta or RC.