0

OS: Mac Appium デスクトップ 1.6.2 Java 1.8 アプリ---ネイティブ----Android

こんにちは、みんな、

これは、ここ数日間私を夢中にさせています。

希望する機能は正しいようです。

Android デバイスでデバッグを有効にしています

adb devices 経由で自分のデバイスを確認できます

しかし、コードを実行すると、

An unknown server-side error occurred while processing the command.

だから私は このリンクに行き 、それを手紙にたどり、情報を正しく追加しましたが、それでも同じエラーメッセージが表示されました.

私は完全に混乱しています。モバイル デバイスに既にインストールされているアプリを開始するのを手伝ってくれる人はいますか?

(注: セキュリティ上の理由から、デバイスと IP アドレスは変更されています)

必要な機能は次のとおりです。

パッケージの基本;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;

public class AndroidDevice {

public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "420XXXXXXXXXX");
cap.setCapability(MobileCapabilityType.VERSION, "5.1.1");
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
cap.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.pintrest");
cap.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, ".activity.PinterestActivity ");
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"),cap);
//com.pinterest/.activity.PinterestActivity
}

ここに日食からのプリントアウトがあります

  Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find package com.skype.raider.Main on the device (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.23 seconds
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:22.379Z'
System info: host: 'Jacquelines-MacBook-Air.local', ip: '100.100.0.0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.5', java.version: '1.8.0_71'
Driver info: driver.version: AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at basics.AndroidDevice.main(AndroidDevice.java:25)enter code here

最後に、Appium デスクトップ

[info] [Appium] Welcome to Appium v1.8.1
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"desiredCapabilities":{"appActivity":".activityPintestActivity","appPackage":"com.pintrest","deviceName":"Android device","newCommandTimeout":"25","platformName":"Android"},"capabilities":{"desiredCapabilities":{"appActivity":".activityPintestActivity","appPackage":"com.pintrest","deviceName":"Android device","newCommandTimeout":"25","platformName":"Android"},"firstMatch":[{"platformName":"android"}]}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":".activityPintestActivity","appPackage":"com.pintrest","deviceName":"Android device","newCommandTimeout":"25","platformName":"Android"},null,{"desiredCapabilities":{"appActivity":".activityPintestActivity","appPackage":"com.pintrest","deviceName":"Android device","newCommandTimeout":"25","platformName":"Android"},"firstMatch":[{"platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1531662783699 (14:53:03 GMT+0100 (BST))
[warn] [Appium] Could not parse W3C capabilities: 'deviceName' can't be blank. Falling back to JSONWP protocol.
[warn] [Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["appActivity","appPackage","deviceName","newCommandTimeout","platformName"]. Falling back to JSONWP protocol.
[info] [Appium] Creating new AndroidDriver (v2.7.0) session
[info] [Appium] Capabilities:
[info] [Appium] appActivity: .activityPintestActivity
[info] [Appium] appPackage: com.pintrest
[info] [Appium] deviceName: Android device
[info] [Appium] newCommandTimeout: 25
[info] [Appium] platformName: Android
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"appActivity":".activityPi...
[warn] [BaseDriver] Capability 'newCommandTimeout' changed from string ('25') to integer (25). This may cause unexpected behavior
[info] [BaseDriver] Session created with session id: d423599b-1e41-47b9-8f88-bca2f4cde044
[debug] [AndroidDriver] Getting Java version
[info] [AndroidDriver] Java version is: 1.8.0_71
[info] [AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[info] [AndroidDriver] Using device: 4200000002400
[debug] [ADB] Setting device id to 4200000000400
[info] [AndroidDriver] App file was not listed, instead we're going to run com.pintrest directly on the device
[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Running '/Users/jacquelinegeorge/Library/Android/sdk/platform-tools/adb -P 5037 -s 420015649a5e2400 shell pm list packages com.pintrest'[error] [AndroidDriver] Error: Could not find package com.pintrest on the device
[error] [AndroidDriver] at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[error] [AndroidDriver] at AndroidDriver.checkPackagePresent$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-driver/lib/driver.js:346:11)
[error] [AndroidDriver] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[error] [AndroidDriver] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[error] [AndroidDriver] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js10021)
[error] [AndroidDriver] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[error] [AndroidDriver] at 
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[debug] [ADB] Running '/Users/jacquelinegeorge/Library/Android/sdk/platform-tools/adb -P 5037 -s 420015649a5e2400 shell am force-stop io.appium.unlock'[debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1531662785119 (14:53:05 GMT+0100 (BST))
[error] [MJSONWP] Encountered internal error running command: Error: Could not find package com.pintrest on the device
[error] [MJSONWP] at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[error] [MJSONWP] at AndroidDriver.checkPackagePresent$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-driver/lib/driver.js:346:11)
[error] [MJSONWP] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[error] [MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[error] [MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js10021)
[error] [MJSONWP] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[error] [MJSONWP] at 
[info] [HTTP] <-- POST /wd/hub/session 500 1425 ms - 186
[info] [HTTP]
4

2 に答える 2