Appium appium 启动真机应用时报错

pan · February 08, 2018 · Last by pan replied at February 08, 2018 · 3527 hits

在启动真机应用时,我已经多次核实了appPackage,appActivity,但是还是出现报错,麻烦各位帮忙看下
真机系统为安卓4.2.2,出现这个报错时,发现真机没有成功安装appium setting 这个控件
appium日志如下:
[2018-02-08 03:35:44][BaseDriver] Event 'newSessionRequested' logged at 1518075344590 (15:35:44 GMT+0800 (中国标准时间))
[2018-02-08 03:35:44][Appium] Creating new AndroidDriver (v1.37.0) session
[2018-02-08 03:35:44][Appium] Capabilities:
[2018-02-08 03:35:44][Appium] appActivity: com.geetion.rfid.activity.v2.LoginActivityV2
[2018-02-08 03:35:44][Appium] appPackage: com.geetion.rfid
[2018-02-08 03:35:44][Appium] deviceName: 0123456789ABCDEF
[2018-02-08 03:35:44][Appium] platformName: android
[2018-02-08 03:35:44][Appium] newCommandTimeout: 0
[2018-02-08 03:35:44][Appium] connectHardwareKeyboard: true
[2018-02-08 03:35:44][BaseDriver] The following capabilities were provided, but are not recognized by appium: connectHardwareKeyboard.
[2018-02-08 03:35:44][BaseDriver] Session created with session id: 3eeed5ff-283b-4b30-9fbb-cfb5bbd7dc59
[2018-02-08 03:35:44][AndroidDriver] Getting Java version
[2018-02-08 03:35:44][AndroidDriver] Java version is: 1.8.0_151
[2018-02-08 03:35:44][ADB] Checking whether adb is present
[2018-02-08 03:35:44][AndroidDriver] Retrieving device list
[2018-02-08 03:35:44][ADB] Trying to find a connected android device
[2018-02-08 03:35:44][ADB] Getting connected devices...
[2018-02-08 03:35:45][ADB] 1 device(s) connected
[2018-02-08 03:35:45][AndroidDriver] Using device: 0123456789ABCDEF
[2018-02-08 03:35:45][ADB] Checking whether adb is present
[2018-02-08 03:35:45][ADB] Setting device id to 0123456789ABCDEF
[2018-02-08 03:35:45][AndroidDriver] App file was not listed, instead we're going to run com.geetion.rfid directly on the device
[2018-02-08 03:35:45][AndroidDriver] Checking whether package is present on the device
[2018-02-08 03:35:45][ADB] Getting connected devices...
[2018-02-08 03:35:45][ADB] 1 device(s) connected
[2018-02-08 03:35:45][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","pm","list","packages","com.geetion.rfid"]
[2018-02-08 03:35:45][AndroidDriver] Starting Android session
[2018-02-08 03:35:45][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","wait-for-device"]
[2018-02-08 03:35:46][ADB] Getting connected devices...
[2018-02-08 03:35:46][ADB] 1 device(s) connected
[2018-02-08 03:35:46][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","echo","ping"]
[2018-02-08 03:35:46][AndroidDriver] setDeviceLanguageCountry requires language or country.
[2018-02-08 03:35:46][AndroidDriver] Got language: 'undefined' and country: 'undefined'
[2018-02-08 03:35:46][Logcat] Starting logcat capture
[2018-02-08 03:35:46][AndroidDriver] Pushing settings apk to device...
[2018-02-08 03:35:46][ADB] Getting install status for io.appium.settings
[2018-02-08 03:35:46][ADB] Getting connected devices...
[2018-02-08 03:35:46][ADB] 1 device(s) connected
[2018-02-08 03:35:46][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","pm","list","packages","io.appium.settings"]
[2018-02-08 03:35:48][ADB] App is not installed
[2018-02-08 03:35:48][ADB] App 'C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk' not installed. Installing
[2018-02-08 03:35:48][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","install","C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk"]
[2018-02-08 03:35:49][ADB] Getting connected devices...
[2018-02-08 03:35:49][ADB] 1 device(s) connected
[2018-02-08 03:35:49][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","getprop","ro.build.version.sdk"]
[2018-02-08 03:35:49][ADB] Current device property 'ro.build.version.sdk': 15
[2018-02-08 03:35:49][ADB] Device API level: 15
[2018-02-08 03:35:49][ADB] Getting connected devices...
[2018-02-08 03:35:49][ADB] 1 device(s) connected
[2018-02-08 03:35:49][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","dumpsys","package","io.appium.settings"]
[2018-02-08 03:35:49][ADB] Getting connected devices...
[2018-02-08 03:35:49][ADB] 1 device(s) connected
[2018-02-08 03:35:49][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","ps"]
[2018-02-08 03:35:49][ADB] Device API level: 15
[2018-02-08 03:35:49][ADB] Getting connected devices...
[2018-02-08 03:35:50][ADB] 1 device(s) connected
[2018-02-08 03:35:50][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","am","start","-W","-n","io.appium.settings/.Settings","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[2018-02-08 03:35:50][ADB] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
at Object.wrappedLogger.errorAndThrow (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:89:13)
at tryCatch (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
at Object.wrappedLogger.errorAndThrow (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:89:13)
at tryCatch (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
[2018-02-08 03:35:50][ADB] Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
at Object.wrappedLogger.errorAndThrow (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
at Object.wrappedLogger.errorAndThrow (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:101:9)
at tryCatch (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
[2018-02-08 03:35:50][AndroidDriver] Failed to launch settings app: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[2018-02-08 03:35:50][ADB] Device API level: 15
[2018-02-08 03:35:50][ADB] Getting connected devices...
[2018-02-08 03:35:50][ADB] 1 device(s) connected
[2018-02-08 03:35:50][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","settings","put","secure","mock_location","1"]
[2018-02-08 03:35:51][AndroidDriver] Pushing unlock helper app to device...
[2018-02-08 03:35:51][ADB] Getting install status for io.appium.unlock
[2018-02-08 03:35:51][ADB] Getting connected devices...
[2018-02-08 03:35:51][ADB] 1 device(s) connected
[2018-02-08 03:35:51][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","pm","list","packages","io.appium.unlock"]
[2018-02-08 03:35:52][ADB] App is installed
[2018-02-08 03:35:52][ADB] Getting package info for io.appium.unlock
[2018-02-08 03:35:52][ADB] Getting connected devices...
[2018-02-08 03:35:52][ADB] 1 device(s) connected
[2018-02-08 03:35:52][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","dumpsys","package","io.appium.unlock"]
[2018-02-08 03:35:52][ADB] Checking whether aapt is present
[2018-02-08 03:35:52][ADB] The installed 'io.appium.unlock' package does not require upgrade (2 >= 2)
[2018-02-08 03:35:52][ADB] Getting device platform version
[2018-02-08 03:35:52][ADB] Getting connected devices...
[2018-02-08 03:35:52][ADB] 1 device(s) connected
[2018-02-08 03:35:52][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","getprop","ro.build.version.release"]
[2018-02-08 03:35:52][ADB] Current device property 'ro.build.version.release': 4.0.4
[2018-02-08 03:35:52][ADB] Getting connected devices...
[2018-02-08 03:35:52][ADB] 1 device(s) connected
[2018-02-08 03:35:52][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","wm","size"]
[2018-02-08 03:35:52][ADB] Getting connected devices...
[2018-02-08 03:35:53][ADB] 1 device(s) connected
[2018-02-08 03:35:53][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","getprop","ro.product.model"]
[2018-02-08 03:35:53][ADB] Current device property 'ro.product.model': C4000
[2018-02-08 03:35:53][ADB] Getting connected devices...
[2018-02-08 03:35:53][ADB] 1 device(s) connected
[2018-02-08 03:35:53][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","getprop","ro.product.manufacturer"]
[2018-02-08 03:35:53][ADB] Current device property 'ro.product.manufacturer': alps
[2018-02-08 03:35:53][AndroidDriver] No app sent in, not parsing package/activity
[2018-02-08 03:35:53][AndroidDriver] No app capability. Assuming it is already on the device
[2018-02-08 03:35:53][AndroidDriver] Running fast reset (stop and clear)
[2018-02-08 03:35:53][ADB] Getting connected devices...
[2018-02-08 03:35:53][ADB] 1 device(s) connected
[2018-02-08 03:35:53][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","am","force-stop","com.geetion.rfid"]
[2018-02-08 03:35:54][ADB] Getting connected devices...
[2018-02-08 03:35:54][ADB] 1 device(s) connected
[2018-02-08 03:35:54][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","pm","clear","com.geetion.rfid"]
[2018-02-08 03:35:55][AndroidBootstrap] Watching for bootstrap disconnect
[2018-02-08 03:35:55][ADB] Forwarding system: 4724 to device: 4724
[2018-02-08 03:35:55][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","forward","tcp:4724","tcp:4724"]
[2018-02-08 03:35:55][UiAutomator] Starting UiAutomator
[2018-02-08 03:35:55][UiAutomator] Moving to state 'starting'
[2018-02-08 03:35:55][UiAutomator] Parsing uiautomator jar
[2018-02-08 03:35:55][UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[2018-02-08 03:35:55][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","push","C:\Users\admin\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-android-bootstrap\bootstrap\bin\AppiumBootstrap.jar","/data/local/tmp/"]
[2018-02-08 03:35:55][ADB] Attempting to kill all uiautomator processes
[2018-02-08 03:35:55][ADB] Getting all processes with uiautomator
[2018-02-08 03:35:55][ADB] Getting connected devices...
[2018-02-08 03:35:55][ADB] 1 device(s) connected
[2018-02-08 03:35:55][ADB] Running 'D:\android-sdk-windows\platform-tools\adb.exe' with args: ["-P",5037,"-s","0123456789ABCDEF","shell","ps"]
[2018-02-08 03:35:55][ADB] No uiautomator process found to kill, continuing...
[2018-02-08 03:35:55][UiAutomator] Starting UIAutomator
[2018-02-08 03:35:55][ADB] Creating ADB subprocess with args: ["-P",5037,"-s","0123456789ABCDEF","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.geetion.rfid","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[2018-02-08 03:35:55][UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
[2018-02-08 03:35:55][UiAutomator] Moving to state 'stopped'
APPIUM填写的信息如下:

共收到 2 条回复 时间 点赞

加个"automationName": "UiAutomator2",试试。

pan #2 · February 08, 2018 作者
lbw 回复

@xmlbw 原文忘记说了,我真机系统时安卓4.2.2,这个不支持😹 😹

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up