Macaca macaca 连接真机问题请教

tongshanshanshan · 发布于 2016年11月30日 · 最后由 tongshanshanshan 回复于 2016年12月22日 · 1046 次阅读

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: <0x7fddce199fd0 xcode.devicetype.iphone>
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()

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

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

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

5338

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

6853

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

6853

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

2457

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

有问题到github提issue

5338

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

96

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

96

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

5338

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

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