2014-02-25 138 views
1

Im新的appium和计划使用它的统一游戏自动化。但是我似乎无法找到应用程序将如何在仿真器/设备上启动?下面是我已经做应用程序不会在仿真器/设备上使用appium

  1. 的步骤来启动仿真器或连接的设备(因为只有一个应连接)
  2. 启动使用appium应用
  3. 的appium服务器从终端
  4. 冉Python脚本

我正在尝试与联系人管理器示例应用程序。下面是Python代码

import os 
from time import sleep 

from selenium import webdriver 

# Returns abs path relative to this file and not cwd 
PATH = lambda p: os.path.abspath(
    os.path.join(os.path.dirname(__file__), p) 
) 

desired_caps = {} 
desired_caps['device'] = 'Android' 
desired_caps['browserName'] = '' 
desired_caps['version'] = '4.2' 
desired_caps['app'] = PATH('/Users/<uname>/Downloads/ContactManager.apk') 
desired_caps['app-package'] = 'com.example.android.contactmanager' 
desired_caps['app-activity'] = '.ContactManager' 
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) 

print driver.get_window_size() 

下面是从appium应用

info: Using local app from desiredCaps: /Users/ears/Downloads/ContactManager.apk 

debug: Request received with params: {"sessionId":null,"desiredCapabilities":{"app-package":"com.example.android.contactmanager","app":"/Users/<uname>/Downloads/ContactManager.apk","browserName":"","version":"4.2","device":"Android","app-activity":".ContactManager"}} 
debug: Using fast reset? true 

info: Creating new appium session 250e7bfd-92bf-4b2a-894c-f4a0e2d02ce7 
info: Starting android appium 
info: Preparing device for session 
info: Checking whether app is actually present 
info: Checking whether adb is present 

debug: Appium request initiated at /wd/hub/status 

info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.15.0","revision":"a7b47d73a27074cc928cc5b325e5d4de1b6e5594"}},"sessionId":"250e7bfd-92bf-4b2a-894c-f4a0e2d02ce7"} 

debug: Request received with params: {} 

GET /wd/hub/status 200 1ms - 199b 

日志在哪里可以找到详细的日志?它不会在模拟器上启动应用程序。我在Mac上,这是Android的。 我在这里错过了一些微不足道的东西吗?

回答

0

在你的代码的问题是通过读取appium日志,尤其是此行强调:

debug: Request received with params: {"sessionId":null,"desiredCapabilities":{"app-package":"com.example.android.contactmanager","app":"/Users//Downloads/ContactManager.apk","browserName":"","version":"4.2","device":"Android","app-activity":".ContactManager"}} debug: Using fast reset? true

你可以看到它包括路径/Users//Downloads/ContactManager.apk,这不是一个有效的路径。看起来您需要将代码中的<uname>更改为实际的字符串。

2

我已经错误地设置为路径变量

..../sdk/tools/ 

代替

..../sdk/ 

更改该固定它。

相关问题