Appium appium 测试 Android 模拟器错误 ,求助

Leticia · 2016年08月03日 · 最后由 Leticia 回复于 2016年08月04日 · 1821 次阅读
  1. appium 运行 py,一直循环输出信息,模拟器无反应
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformVersion":"6
.0","...
[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium]   platformVersion: '6.0'
[Appium]   deviceName: 'Android Emulator'
[Appium]   platformName: 'Android'
[Appium]   appActivity: '.Calculator'
[Appium]   appPackage: 'com.android.calculator2'
[BaseDriver] Session created with session id: f3284465-a9d5-47a6-82ac-d9696f106e
bc
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_101
[ADB] Checking whether adb is present
[ADB] Using adb.exe from F:\Android\android-sdk\platform-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] Looking for a device with Android 6.0
[debug] [ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb.exe from F:\Android\android-sdk\platform-tools\adb.exe
[debug] [ADB] Setting device id to emulator-5554
[AndroidDriver] App file was not listed, instead we're going to run com.android.
calculator2 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 F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","shell","pm","list","packages","com.android.calcu
lator2"]
[AndroidDriver] Starting Android session
[debug] [ADB] Running F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","wait-for-device"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","shell","echo","ping"]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Running F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","install","C:\\Users\\Administrator\\AppData\\Roa
ming\\npm\\node_modules\\appium\\node_modules\\appium-android-driver\\node_modul
es\\io.appium.settings\\bin\\settings_apk-debug.apk"]
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Running F:\Android\android-sdk\platform-tools\adb.exe with args: [
"-P",5037,"-s","emulator-5554","install","C:\\Users\\Administrator\\AppData\\Roa

求助,大神有么。麻烦帮忙看下呢

共收到 6 条回复 时间 点赞

。。。脚本贴出来瞧瞧

  1. 脚本贴出来看看?
  2. 从日志上看,运行正常啊,只是还没走到启动应用那一步。

#2 楼 @chenhengjie123

就酱紫的

from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['appPackage'] = 'com.android.calculator2'
desired_caps['appActivity'] = '.Calculator'

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
ddriver.find_element_by_id('com.android.calculator2:id/digit9').click()

#3 楼 @leticia 你是等到它运行完成都没有打开应用?

或者你把从它开始执行到完成执行的完整 appium server log 贴上来?

#3 楼 @leticia ddriver 多了一个 d 吧

#5 楼 @mystique
去掉勾选 launch avd 就可以了
有新的 bug 了:

info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity)","origValue":"Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity"},"sessionId":null}

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册