Macaca macaca 连接真机问题请教

woyebuzhidaowoshishei · 2016年11月30日 · 最后由 达峰的夏天 回复于 2018年03月21日 · 2516 次阅读

macaca 连接真机一直提示:please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj,但是没有提示错误。脚本无法执行。

环境

iOS: 10.0
XCode: 8.1
python: 3.4

macaca doctor

macaca-doctor version: 1.0.27

Node.js checklist:

node env: /usr/local/bin/node
node version: v6.8.1

iOS checklist:

Xcode is installed at: /Applications/Xcode.app/Contents/Developer
Xcode Command Line Tools is ready, version: 2345.1.
iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy
ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.8.0_91
JAVA_HOME is set to /library/java/javavirtualmachines/jdk1.8.0_91.jdk/contents/home
ANDROID_HOME is set to /usr/local/opt/android-sdk
platforms directory is not exist

Installed driver list:

ios: 1.0.46

log

index.js:17:12 [master] pid:30644 webdriver server start with config:
{ port: 3456,
verbose: true,
always: true,
ip: '192.168.1.36',
host: 'ununtrium.local',
loaded_time: '2016-11-30 17:06:41' }
middlewares.js:17:10 [master] pid:30644 base middlewares attached
router.js:129:10 [master] pid:30644 router set
webdriver sdk launched
responseHandler.js:11:12 [master] pid:30644 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"bundleId":"xx","deviceName":"iPhone 5","platformName":"iOS","platformVersion":"10.0","udid":"xx"}}
session.js:47:10 [master] pid:30644 Creating session, sessionId: 21653d15-6b71-4310-a25c-4b93ea19e3fe.
xctest-client.js:56:14 [master] pid:30644 project path: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
macaca-ios.js:144:10 [master] pid:30644 {
"bundleId": "xx",
"platformName": "iOS",
"platformVersion": "10.0"
}
xctest-client start with port: 8901
xctest-client.js:233:14 [master] pid:30644 xcode version: 8.1
WebDriverAgent version: 1.0.36
xctest-client.js:170:14 [master] pid:30644 2016-11-30 17:06:48.614 xcodebuild[30652:701887] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/sara/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/EB1F4F5B-2E35-4742-A399-283FCCDD9A43/Session-WebDriverAgentRunner-2016-11-30_170648-ypTeXh.log
2016-11-30 17:06:48.614 xcodebuild[30652:701884] [MT] IDETestOperationsObserverDebug: (BA6FFFFB-4CD0-4A73-9A5B-E2A3FD4BD618) Beginning test session WebDriverAgentRunner-BA6FFFFB-4CD0-4A73-9A5B-E2A3FD4BD618 at 2016-11-30 17:06:48.613 with Xcode 8B62 on target {
deviceSerialNumber: C39MDH81FRC5
identifier: 43d388600e6a6f0ca35ed991f73ae96eb30f59aa
deviceClass: iPhone
deviceName: BTCC's iPhone5
deviceIdentifier: 43d388600e6a6f0ca35ed991f73ae96eb30f59aa
productVersion: 10.0.1
buildVersion: 14A403
deviceSoftwareVersion: 10.0.1 (14A403)
deviceArchitecture: arm64
deviceTotalCapacity: 12088623104
deviceAvailableCapacity: 7091499008
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (10.0.1 (14A403))

xctest-client.js:171:14 [master] pid:30644 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:30644 MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/0q/d31vt2395c3gd028gzysbx3r0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/3c13836573226534d387cb31a1801fd8/43d388600e6a6f0ca35ed991f73ae96eb30f59aa/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/sara/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/0q/d31vt2395c3gd028gzysbx3r0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.khPpWH/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/0q/d31vt2395c3gd028gzysbx3r0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.khPpWH/WebDriverAgentRunner-Runner.app_sparse.ipa

xctest-client.js:171:14 [master] pid:30644 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:30644 __MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/0q/d31vt2395c3gd028gzysbx3r0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.khPpWH/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

xctest-client.js:171:14 [master] pid:30644 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:30644 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/0q/d31vt2395c3gd028gzysbx3r0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.khPpWH/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

xctest-client.js:171:14 [master] pid:30644 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
proxy.js:56:14 [master] pid:30644 Proxy: /session:POST to http://127.0.0.1:8901/session:POST with body: {"desiredCapabilities":{"bundleId":"xx","platformName":"iOS","platformVersion":"10.0"}}
proxy.js:79:20 [master] pid:30644 Got response with status 200: {"value":{"sessionId":"CB6DF468-F451-4FEF-90F1-C67EB5213E24","capabilities":{"device":"iphone","browserName":" ","sdkVersion":"10.0.1","CFBundleIdentifier":"local.pid.52"}},"sessionId":null,"status...
responseHandler.js:47:14 [master] pid:30644 Send HTTP Respone to Client: {"sessionId":"21653d15-6b71-4310-a25c-4b93ea19e3fe","status":0,"value":"{\"bundleId\":\"xx\",\"deviceName\":\"iPhone 5\",\"platformName\":\"iOS\",\"platformVersion\":\"10.0\",\"udid\":\"xx\"}"}

python 脚本

import unittest
import os
import time
from macaca import WebDriver


desired_caps = {
    'platformName': 'iOS',
    'platformVersion': '10.0',
    'deviceName': 'iPhone 5',
    'bundleId': 'xx',
    'udid': 'xx',
}

server_url = {
    'hostname': 'ununtrium.local',
    'port': 3456,
}

class MacacaTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = WebDriver(desired_caps, server_url)
        cls.driver.init()

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    def test_01_login(self):
        self.driver.element('name', 'Clear').click()
        self.driver.element('name', '1').click()

if __name__ == '__main__':
    unittest.main()

不知道有没有人遇到过这个问题呢?

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 11 条回复 时间 点赞

我要吐血了,我解决了。是 app 要用 debug 版的。我居然在这个问题上卡一天,十分佩服我自己。。。。

为何我修改 webdriveranget 的 displayname 和 bundleID 都不成功。显示的都是原来的 id,而且 bundle id 都不是我修改的 bundleid。
@xdf

#1 楼 @tongshanshanshan 从原理上是任何 app 都可以测试的

你要不用下这个,其实原理也很简单。https://github.com/openatx/facebook-wda 华米的兄弟目前有人在用

参考这篇文章,https://testerhome.com/topics/6503

有问题到 github 提 issue

#4 楼 @codeskyblue 好的,我会看看的。感谢推荐。

遇到相同的问题,请问楼主是怎么解决的?求教

怎么用 debug 版的?可以说的详细点吗,感谢🙏

#9 楼 @GeorgeZh app 在打包的时候打 debug 版的啊。。

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