Как разблокировать Android используя Appium

webdriver
Теги: #<Tag:0x00007fedc46284c8>

(t62) #1

Нужна помощь.
кто то вообще в курсе как автоматически разблокировать девайс, в даном случае андроид

искал в инете, увидел только такие реализации -
((AndroidDriver)webDriver).unlockDevice();
или -
Integer x_topLeftCorner=214;
Integer y_topLeftCorner=779;

Integer x_topRightCorner=869;
Integer y_topRightCorner=787;

        Integer x_bottomLeftCorner=207;
        Integer y_bottomLeftCorner=1438;

        Integer x_bottomRightCorner=873;
        Integer y_bottomRightCorner=1446;

//Use coordinates to draw the security pattern and unlock the screen
TouchAction obj = new TouchAction((AndroidDriver)webDriver); obj.press(x_topLeftCorner,y_topLeftCorner).moveTo(x_topRightCorner,y_topRightCorner).moveTo(x_bottomLeftCorner,y_bottomLeftCorner).moveTo(x_bottomRightCorner,y_bottomRightCorner).release().perform();

по логике вещей думаю должен работать первый вариант, но как то ничего, екран подсветился и всё.


(vmaximv) #2

Логи покажите


(t62) #3

command - ((AndroidDriver)webDriver).unlockDevice();

[Appium] browserName: ‘Chrome’
[Appium] platformName: ‘Android’
[Appium] version: ‘6.0.1’
[Appium] deviceName: ‘GalaxyTabA’
[Appium] platform: ‘ANDROID’
[Appium] udid: ‘520312df432f9383’
[Appium] noReset: true
[debug] [AndroidDriver] AndroidDriver version: 1.10.38
[BaseDriver] The following capabilities were provided, but are not recognized by
appium: proxy, version, platform.
[BaseDriver] Session created with session id: a324d985-7788-4630-b59e-d1e078a841
96
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_121
[AndroidDriver] We’re going to run a Chrome-based session
[AndroidDriver] Chrome-type package and activity are com.android.chrome and com.
google.android.apps.chrome.Main
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 520312df432f9383
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[debug] [ADB] Setting device id to 520312df432f9383
[AndroidDriver] App file was not listed, instead we’re going to run com.android.
chrome directly on the device
[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“pm”,“list”
,“packages”,“com.android.chrome”]
[AndroidDriver] Starting Android session
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“wait-for-device”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“echo”,“pin
g”]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“install”,“C:\User
s\user\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.se
ttings\bin\settings_apk-debug.apk”]
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“install”,“C:\User
s\user\AppData\Roaming\npm\node_modules\appium\node_modules\appium-unloc
k\bin\unlock_apk-debug.apk”]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.release"]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“dumpsys”,"
window"]
[AndroidDriver] Unlocking screen
[debug] [AndroidDriver] Screen is locked, trying to unlock
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“force
-stop”,“io.appium.unlock”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.sdk"]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []


(vmaximv) #4

(t62) #5

добавил, но ничего нового, после того как экран включился, нужно пальцем вверх а потом ввести пароль…
возможно поэтому он не хочет
в capabilities добавил
“unlockType”: “pin”,
“unlockKey”: “хххх”


(vmaximv) #6

логи


(t62) #7

{
“capabilities”:
[
{
“version”:“6.0.1”,
“maxInstances”: 1,
“platform”:“ANDROID”,
“newCommandTimeout”:“60”,
“deviceReadyTimeout”:5,
“udid”:“520312df432f9383”,
“deviceName”: “GalaxyTabA”,
“noReset”:true,
“browserName”:“Chrome”,
“unlockType”: “pin”,
“unlockKey”: “хххх”
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:10800,
“url”:“http://127.0.0.1:4736/wd/hub”,
“host”: “127.0.0.1”,
“port”: 4736,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“maxSession”: 3,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4444,
“hubHost”: “127.0.0.1”,
“hub”:“http://127.0.0.1:4444/grid/register/”,
“role”: “node”
}
}

DesiredCapabilities capabilities = driverMethod.BMP().getBmpGeneral().getCapabilities(EventBMP.BrowseTypes.ANDROID);

        String word = paramBrowser.typeBrowser.toLowerCase();
        word = word.substring(0, 1).toUpperCase() + word.substring(1);

        capabilities.setCapability(CapabilityType.BROWSER_NAME, word); //Name of mobile web browser to automate. Should be an empty string if automating an app instead.
        capabilities.setCapability(CapabilityType.PLATFORM, "Android");

        capabilities.setCapability(CapabilityType.VERSION, StartController.getController().getPropMobileCapabilites(paramBrowser.udidDevice, "version"));

        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, StartController.getController().getPropMobileCapabilites(paramBrowser.udidDevice, "deviceName"));

   webDriver = new AndroidDriver(new URL("http://127.0.0.1:4444/wd/hub"), capabilities);

[Appium] browserName: ‘Chrome’
[Appium] platformName: ‘Android’
[Appium] version: ‘6.0.1’
[Appium] deviceName: ‘GalaxyTabA’
[Appium] platform: ‘ANDROID’
[Appium] udid: ‘520312df432f9383’
[Appium] noReset: true
[debug] [AndroidDriver] AndroidDriver version: 1.10.38
[BaseDriver] The following capabilities were provided, but are not recognized by
appium: proxy, version, platform.
[BaseDriver] Session created with session id: 78a98fa3-9b97-4bd9-83da-4039744641
ff
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_121
[AndroidDriver] We’re going to run a Chrome-based session
[AndroidDriver] Chrome-type package and activity are com.android.chrome and com.
google.android.apps.chrome.Main
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 520312df432f9383
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[debug] [ADB] Setting device id to 520312df432f9383
[AndroidDriver] App file was not listed, instead we’re going to run com.android.
chrome directly on the device
[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“pm”,“list”
,“packages”,“com.android.chrome”]
[AndroidDriver] Starting Android session
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“wait-for-device”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“echo”,“pin
g”]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“install”,“C:\User
s\user\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.se
ttings\bin\settings_apk-debug.apk”]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“install”,“C:\User
s\user\AppData\Roaming\npm\node_modules\appium\node_modules\appium-unloc
k\bin\unlock_apk-debug.apk”]
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.release"]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“dumpsys”,"
window"]
[AndroidDriver] Unlocking screen
[debug] [AndroidDriver] Screen is locked, trying to unlock
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“force
-stop”,“io.appium.unlock”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.sdk"]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] <-- GET /wd/hub/status - - ms - -


(vmaximv) #8

Вы по линку все внимательно прочитали, и вас не смутило, что unlock по прежнему идет через io.appium.unlock?

Данные capabilities были заимплеменчены в 1.12


(t62) #9

спасибо что напомнили за обновление , но ничего нового

[Appium] browserName: ‘Chrome’
[Appium] platformName: ‘Android’
[Appium] version: ‘6.0.1’
[Appium] deviceName: ‘GalaxyTabA’
[Appium] platform: ‘ANDROID’
[Appium] udid: ‘520312df432f9383’
[Appium] noReset: true
[debug] [AndroidDriver] AndroidDriver version: 1.20.0
[BaseDriver] The following capabilities were provided, but are not recognized by
appium: proxy, version, platform.
[BaseDriver] Session created with session id: e6f971c5-be79-4527-b562-9409b0515b
a2
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_121
[AndroidDriver] We’re going to run a Chrome-based session
[AndroidDriver] Chrome-type package and activity are com.android.chrome and com.
google.android.apps.chrome.Main
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 520312df432f9383
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\user\AppData\Local\Android\android-sdk\platfor
m-tools\adb.exe
[debug] [ADB] Setting device id to 520312df432f9383
[AndroidDriver] App file was not listed, instead we’re going to run com.android.
chrome directly on the device
[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“pm”,“list”
,“packages”,“com.android.chrome”]
[AndroidDriver] Starting Android session
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“wait-for-device”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“echo”,“pin
g”]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“pm”,“list”
,“packages”,“io.appium.settings”]
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for io.appium.settings
[debug] [ADB] Getting connected devices…
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Users\user\AppData\Local\Android\android-sdk\build-
tools\25.0.2\aapt.exe
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“dumpsys”,"
package",“io.appium.settings”]
[ADB] Cannot read version codes of C:\Users\user\AppData\Roaming\npm\node_module
s\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debu
g.apk and/or io.appium.settings. Assuming correct app version is already install
ed
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.sdk"]
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“dumpsys”,"
package",“io.appium.settings”]
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“install”,“C:\User
s\user\AppData\Roaming\npm\node_modules\appium\node_modules\appium-unloc
k\bin\unlock_apk-debug.apk”]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“appops”,“s
et”,“io.appium.settings”,“android:mock_location”,“allow”]
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.build.version.release"]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“wm”,“size”
]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.product.model"]
[debug] [ADB] Current device property ‘ro.product.model’: SM-T580
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“getprop”,"
ro.product.manufacturer"]
[debug] [ADB] Current device property ‘ro.product.manufacturer’: samsung
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [AndroidDriver] No app capability. Assuming it is already on the device
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4733 to device: 4724
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“forward”,“tcp:4733
“,“tcp:4724”]
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: [”-P”,5037,"-s",“520312df432f9383”,“push”,“C:\Users\
user\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-
bootstrap\bootstrap\bin\AppiumBootstrap.jar”,"/data/local/tmp/"]
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“ps”]
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“520312df432f93
83”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.androi
d.bootstrap.Bootstrap”,"-e",“pkg”,“com.android.chrome”,"-e",“disableAndroidWatch
ers”,false,"-e",“acceptSslCerts”,false]
[debug] [UiAutomator] Moving to state ‘online’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Loading json…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[debug] [ADB] Getting connected devices…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“dumpsys”,"
window"]
[debug] [AndroidDriver] Screen is locked, trying to unlock
[AndroidDriver] Using app unlock, this is going to be deprecated!
[AndroidDriver] Unlocking screen
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“force
-stop”,“io.appium.unlock”]
[HTTP] <-- GET /wd/hub/status - - ms - -
[debug] [AndroidBootstrap] Emitting alert message…
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[HTTP] <-- GET /wd/hub/status - - ms - -
[debug] [ADB] Device API level: 23
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘C:\Users\user\AppData\Local\Android\android-sdk\platform-
tools\adb.exe’ with args: ["-P",5037,"-s",“520312df432f9383”,“shell”,“am”,“start
“,”-W”,"-n",“io.appium.unlock/.Unlock”,"-a",“android.intent.action.MAIN”,"-c",“a
ndroid.intent.category.LAUNCHER”,"-f",“0x10200000”]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []


(vmaximv) #10

не вижу capabilities "unlockType": "pin", "unlockKey": "хххх"

PS: прячьте логи под [details=Спойлер][/details] или линкуйте на gist


(t62) #11

обновил 5.0.0-BETA5 на 5.0.0-BETA8
стал крешится селениум грид… стало стрёмно…
пока написал костыль для разблокировки, нету времени пока разбиратся.
кому возможно понадобится -

public void unlockDevice(String udid){
try {
Process process = Runtime.getRuntime().exec(“cmd /c start adb -s " + udid + " shell input keyevent 26”);
Thread.sleep(150);
process.destroy();
process = Runtime.getRuntime().exec(“cmd /c start adb -s " + udid + " shell input touchscreen swipe 930 880 930 380”);
Thread.sleep(500);
process.destroy();
process = Runtime.getRuntime().exec(“cmd /c start adb -s " + udid + " shell input text хххх”);
Thread.sleep(2000);
process.destroy();
process = Runtime.getRuntime().exec(“cmd /c start adb -s " + udid + " shell input keyevent 66”);
Thread.sleep(150);
process.destroy();

    } catch (IOException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}