macacajs / app-inspector

App-inspector is a mobile UI viewer in browser.
https://macacajs.github.io/app-inspector/
MIT License
389 stars 78 forks source link

app-inspector连接iOS真机提示Internal Server Error #250

Closed miaodamao closed 4 years ago

miaodamao commented 4 years ago

Environment check:

$ npm i macaca-cli -g && macaca doctor

macaca-doctor version: 2.0.18

Node.js checklist:

node env: /usr/local/bin/node node version: v14.2.0

iOS checklist:

macOS version: 10.15.2 Xcode Command Line Tools is ready, version: 2373. xcodebuild version: 11.6 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 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home ANDROID_HOME is set to /usr/local/android-sdk-macosx Platforms is set to /usr/local/android-sdk-macosx/platforms/android-29 ADB tool is set to /usr/local/android-sdk-macosx/platform-tools/adb gradle is installed, version: 6.4

Installed driver list:

android: 2.2.1 location: /usr/local/lib/node_modules/macaca-android

ios: 2.1.0 location: /usr/local/lib/node_modules/macaca-ios


xctest-client.js:230:20 [master] pid:10854 hitted for default mode xctest-client.js:222:18 [master] pid:10854 2020-07-20 19:16:29.238 xcodebuild[10857:163111] [MT] IDETestOperationsObserverDebug: (2D1A0F27-C3D4-41F5-9293-47C55854B407) Beginning test session XCTestWDUITests-2D1A0F27-C3D4-41F5-9293-47C55854B407 at 2020-07-20 19:16:29.238 with Xcode 11E708 on target 📱<DVTiOSDevice (0x7fc333038440), iPhone (2), iPhone, 13.4.1 (17E262), 00008020-001C09040144002E> { deviceSerialNumber: F2LXJ1JHKPJ1 identifier: 00008020-001C09040144002E deviceClass: iPhone deviceName: iPhone (2) deviceIdentifier: 00008020-001C09040144002E productVersion: 13.4.1 buildVersion: 17E262 deviceSoftwareVersion: 13.4.1 (17E262) deviceArchitecture: arm64e deviceTotalCapacity: 57292967936 deviceAvailableCapacity: 38811127808 deviceIsTransient: NO ignored: NO deviceIsBusy: NO deviceIsPaired: YES deviceIsActivated: YES d... xctest-client.js:233:20 [master] pid:10854 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctestwd start with port: 8002 proxy.js:55:14 [master] pid:10854 Proxy: /wd/hub/session:POST to http://127.0.0.1:8002/wd/hub/session:POST with body: {"desiredCapabilities":{}} xctest-client.js:270:16 [master] pid:10854 Invalid listen port specified in argument '8002'!

xctest-client.js:279:14 [master] pid:10854 iproxy exit with code: 234, signal: null proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js:224:18 [master] pid:10854 2020-07-20 19:16:29.357 xcodebuild[10857:163111] [MT] IDETestOperationsObserverDebug: (2D1A0F27-C3D4-41F5-9293-47C55854B407) Finished requesting crash reports. Continuing with testing.

xctest-client.js:233:20 [master] pid:10854 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj helper.js:20:18 [master] pid:10854 retrying... (10 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (9 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (8 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (7 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (6 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:39.407101+0800 XCTestWDUITests-Runner[1462:383145] Running tests...

xctest-client.js:206:16 [master] pid:10854 Test Suite 'All tests' started at 2020-07-20 19:16:40.010

xctest-client.js:206:16 [master] pid:10854 Test Suite 'XCTestWD.framework' started at 2020-07-20 19:16:40.010 Test Suite 'XCTestWD.framework' passed at 2020-07-20 19:16:40.010. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds

xctest-client.js:206:16 [master] pid:10854 Test Suite 'XCTestWDUITests.xctest' started at 2020-07-20 19:16:40.011 Test Suite 'XCTextWDRunner' started at 2020-07-20 19:16:40.011 Test Case '-[XCTestWDUITests.XCTextWDRunner testRunner]' started. t = 0.00s Start Test at 2020-07-20 19:16:40.011

xctest-client.js:206:16 [master] pid:10854 t = 0.03s Set Up

xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:40.057331+0800 XCTestWDUITests-Runner[1462:383145] initializing wd server

xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:40.057579+0800 XCTestWDUITests-Runner[1462:383145] check log dir @:["/var/mobile/Containers/Data/Application/1DEF7D0E-349F-4F98-8F04-B341BFA17516/Documents"]

xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:40:058 XCTestWDUITests-Runner[1462:383145] XCTestWD-Debug-Info: setup debug log 2020-07-20 19:16:40.059299+0800 XCTestWDUITests-Runner[1462:383327] XCTestWD-Debug-Info: setup debug log

xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:40.062610+0800 XCTestWDUITests-Runner[1462:383145] com.facebook.WebDriverAgentRunner.susutestsu.xctrunner

xctest-client.js:206:16 [master] pid:10854 2020-07-20 19:16:40.062665+0800 XCTestWDUITests-Runner[1462:383145] XCTestWDSetup->http://localhost:8002<-XCTestWDSetup

helper.js:20:18 [master] pid:10854 retrying... (5 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (4 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (3 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (2 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js:20:18 [master] pid:10854 retrying... (1 retries left) proxy.js:63:22 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js:316:14 [master] pid:10854 Fail to start xctest: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js:329:14 [master] pid:10854 killing runnerProc pid: 10857 xctest-client.js:335:14 [master] pid:10854 killing iproxyProc pid: 11061 Error: connect ECONNREFUSED 127.0.0.1:8002 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16) { errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 8002 } iOS device started: 00008020-001C09040144002E inspector start at: http://169.254.214.234:5678 xctest-client.js:245:16 [master] pid:10854 xctest client exit with code: null, signal: SIGKILL <-- GET / helper.js:94:16 [master] pid:10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002

Error: connect ECONNREFUSED 127.0.0.1:8002 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16)

macaca-bot commented 4 years ago

This is the translated issue:


iOS app-inspector connect real machine prompts Internal Server Error

Environment check:

`Bash $ Npm i macaca-cli -g && macaca doctor ` macaca-doctor version: 2.0.18

Node.js checklist:

node env: / usr / local / bin / node node version: v14.2.0

iOS checklist:

macOS version: 10.15.2 Xcode Command Line Tools is ready, version: 2373. xcodebuild version: 11.6 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 JAVA_HOME is set to / Library / Java / JavaVirtualMachines / jdk1.8.0_241.jdk / Contents / Home ANDROID_HOME is set to / usr / local / android-sdk-macosx Platforms is set to / usr / local / android-sdk-macosx / platforms / android-29 ADB tool is set to / usr / local / android-sdk-macosx / platform-tools / adb gradle is installed, version: 6.4

Installed driver list:

android: 2.2.1 location: / usr / local / lib / node_modules / macaca-android

ios: 2.1.0 location: / usr / local / lib / node_modules / macaca-ios


xctest-client.js: 230: 20 [master] pid: 10854 hitted for default mode xctest-client.js: 222: 18 [master] pid: 10854 2020-07-20 19: 16: 29.238 xcodebuild [10857: 163111] [MT] IDETestOperationsObserverDebug: (2D1A0F27-C3D4-41F5-9293-47C55854B407) Beginning test session XCTestWDUITests-2D1A0F27-C3D4-41F5-9293-47C55854B407 at 2020-07-20 19: 16: 29.238 with Xcode 11E708 on target 📱 <DVTiOSDevice (0x7fc333038440), iPhone (2), iPhone, 13.4.1 (17E262), 00008020-001C09040144002E> { deviceSerialNumber: F2LXJ1JHKPJ1 identifier: 00008020-001C09040144002E deviceClass: iPhone deviceName: iPhone (2) deviceIdentifier: 00008020-001C09040144002E productVersion: 13.4.1 buildVersion: 17E262 deviceSoftwareVersion: 13.4.1 (17E262) deviceArchitecture: arm64e deviceTotalCapacity: 57292967936 deviceAvailableCapacity: 38811127808 deviceIsTransient: NO ignored: NO deviceIsBusy: NO deviceIsPaired: YES deviceIsActivated: YES d ... xctest-client.js: 233: 20 [master] pid: 10854 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctestwd start with port: 8002 proxy.js: 55: 14 [master] pid: 10854 Proxy: / wd / hub / session: POST to http://127.0.0.1:8002/wd/hub/session:POST with body: { "desiredCapabilities" : {}} xctest-client.js: 270: 16 [master] pid: 10854 Invalid listen port specified in argument '8002'!

xctest-client.js: 279: 14 [master] pid: 10854 iproxy exit with code: 234, signal: null proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js: 224: 18 [master] pid: 10854 2020-07-20 19: 16: 29.357 xcodebuild [10857: 163111] [MT] IDETestOperationsObserverDebug: (2D1A0F27-C3D4-41F5-9293-47C55854B407) Finished requesting crash reports. Continuing with testing.

xctest-client.js: 233: 20 [master] pid: 10854 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj helper.js: 20: 18 [master] pid: 10854 retrying ... (10 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (9 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (8 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (7 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (6 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 39.407101 + 0800 XCTestWDUITests-Runner [1462: 383145] Running tests ...

xctest-client.js: 206: 16 [master] pid: 10854 Test Suite 'All tests' started at 2020-07-20 19: 16: 40.010

xctest-client.js: 206: 16 [master] pid: 10854 Test Suite 'XCTestWD.framework' started at 2020-07-20 19: 16: 40.010 Test Suite 'XCTestWD.framework' passed at 2020-07-20 19: 16: 40.010. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds

xctest-client.js: 206: 16 [master] pid: 10854 Test Suite 'XCTestWDUITests.xctest' started at 2020-07-20 19: 16: 40.011 Test Suite 'XCTextWDRunner' started at 2020-07-20 19: 16: 40.011 Test Case '- [XCTestWDUITests.XCTextWDRunner testRunner]' started. t = 0.00s Start Test at 2020-07-20 19: 16: 40.011

xctest-client.js: 206: 16 [master] pid: 10854 t = 0.03s Set Up

xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 40.057331 + 0800 XCTestWDUITests-Runner [1462: 383145] initializing wd server

xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 40.057579 + 0800 XCTestWDUITests-Runner [1462: 383145] check log dir @: [ "/ var / mobile / Containers / Data / Application / 1DEF7D0E-349F-4F98-8F04-B341BFA17516 / Documents "]

xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 40: 058 XCTestWDUITests-Runner [1462: 383145] XCTestWD-Debug-Info: setup debug log 2020-07-20 19: 16: 40.059299 + 0800 XCTestWDUITests-Runner [1462: 383327] XCTestWD-Debug-Info: setup debug log

xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 40.062610 + 0800 XCTestWDUITests-Runner [1462: 383145] com.facebook.WebDriverAgentRunner.susutestsu.xctrunner

xctest-client.js: 206: 16 [master] pid: 10854 2020-07-20 19: 16: 40.062665 + 0800 XCTestWDUITests-Runner [1462: 383145] XCTestWDSetup-> http: // localhost: 8002 <-XCTestWDSetup

helper.js: 20: 18 [master] pid: 10854 retrying ... (5 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (4 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (3 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (2 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 helper.js: 20: 18 [master] pid: 10854 retrying ... (1 retries left) proxy.js: 63: 22 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js: 316: 14 [master] pid: 10854 Fail to start xctest: Error: connect ECONNREFUSED 127.0.0.1:8002 xctest-client.js: 329: 14 [master] pid: 10854 killing runnerProc pid: 10857 xctest-client.js: 335: 14 [master] pid: 10854 killing iproxyProc pid: 11061 Error: connect ECONNREFUSED 127.0.0.1:8002 at TCPConnectWrap.afterConnect [as oncomplete] (net.js: 1142: 16) { errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 8002 } iOS device started: 00008020-001C09040144002E inspector start at: http://169.254.214.234:5678 xctest-client.js: 245: 16 [master] pid: 10854 xctest client exit with code: null, signal: SIGKILL <- GET / helper.js: 94: 16 [master] pid: 10854 xctest client proxy error with: Error: connect ECONNREFUSED 127.0.0.1:8002

Error: connect ECONNREFUSED 127.0.0.1:8002 at TCPConnectWrap.afterConnect [as oncomplete] (net.js: 1142: 16)

Try app-inspector -u xxxx --verbose for more log detail.

paradite commented 4 years ago

refer to https://github.com/alibaba/macaca/issues/929 first issue