APP——python——自动化环境搭建03——个人详细搭建——夜神模拟

 

参考文档:https://blog.csdn.net/u013314786/article/details/83216390

 

接上文:

 

安装完成后要进行一下简单修改:

(1)、打开安装目录,进入到bin目录(比如:D:\Nox\bin)
(2)、把安装好的Android SDK里的adb.exe文件(比如我的在D:\Android\SDK\platform-tools目录下)复制到该目录覆盖掉该目录已存在的adb.exe文件
(3)、删掉该目录的nox_adb.exe文件,再复制一份adb.exe并重命名为nox_adb.exe
(4)、启动模拟器

 

===========================================================================

确认夜神模拟器是否启动成功:

APP——python——自动化环境搭建03——个人详细搭建——夜神模拟

 

 

 

 

================================================================================

 

启动python,执行脚本

 

#   adb    shell    dumpsys    window    w    |findstr   \/     |findstr    name=
#

from appium import webdriver
import  time

desired_caps = {
    platformName: Android,
    deviceName:127.0.0.1:62001,
    platformVersion: 5.1.1,
    appPackage: com.youdao.calculator,
    appActivity: com.youdao.calculator.activities.MainActivity,
     automationName:UiAutomator1,
}
driver = webdriver.Remote(http://127.0.0.1:4723/wd/hub, desired_caps)
time.sleep(5)

#driver.find_element_by_id(‘com.youdao.calculator:id/guide_button‘).click()

print(driver.current_package)
print(-------------------------)

print(driver.current_activity)
print(-------------------------)

print(driver.capabilities)


time.sleep(5)

driver.quit()

 

执行结果:

com.youdao.calculator
-------------------------
.activities.GuideActivity
-------------------------
{‘platform‘: ‘LINUX‘, ‘webStorageEnabled‘: False, ‘takesScreenshot‘: True, ‘javascriptEnabled‘: True, ‘databaseEnabled‘: False, ‘networkConnectionEnabled‘: True, ‘locationContextEnabled‘: False, ‘warnings‘: {},

‘desired‘: {

‘platformName‘: ‘Android‘,

‘deviceName‘: ‘127.0.0.1:62001‘,

‘platformVersion‘: ‘5.1.1‘,

‘appPackage‘: ‘com.youdao.calculator‘,

‘appActivity‘: ‘com.youdao.calculator.activities.MainActivity‘,

‘automationName‘: ‘UiAutomator1‘

 

}, ‘platformName‘: ‘Android‘, ‘deviceName‘: ‘127.0.0.1:62001‘, ‘platformVersion‘: ‘5.1.1‘, ‘appPackage‘: ‘com.youdao.calculator‘, ‘appActivity‘: ‘com.youdao.calculator.activities.MainActivity‘, ‘automationName‘: ‘UiAutomator1‘, ‘deviceUDID‘: ‘127.0.0.1:62001‘, ‘deviceScreenSize‘: ‘720x1280‘, ‘deviceModel‘: ‘MI 9‘, ‘deviceManufacturer‘: ‘Xiaomi‘}

 

======================================================================================================

APP——python——自动化环境搭建03——个人详细搭建——夜神模拟

 

 

 

APP——python——自动化环境搭建03——个人详细搭建——夜神模拟

 

APP——python——自动化环境搭建03——个人详细搭建——夜神模拟

上一篇:android webview测试


下一篇:iOS otool查看包信息