Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlaunch not retrieving all device information listed by xcrun devicectl #22109

Open
matouskozak opened this issue Feb 4, 2025 · 4 comments
Open
Labels
bug If an issue is a bug or a pull request a bug fix mlaunch
Milestone

Comments

@matouskozak
Copy link

matouskozak commented Feb 4, 2025

We have issues with "newly" updated iPhone lab devices to iOS 17.6 paired with XCode 15.4 (and iOS 18.1 with XCode 16.1) that are not working properly with XHarness (mlaunch). When reporting their status via xcrun devicectl list devices we see the device as "available (paired)".

However, upon retrieving the device information using mlaunch (v. 1.0.272) in https://github.com/matouskozak/xharness/blob/947b4ce2a0f5f514a11d49dd92c1a644d0c17e75/src/Microsoft.DotNet.XHarness.iOS.Shared/Hardware/HardwareDeviceLoader.cs#L60-L67, we are missing the identifier and device is not enabled for debugging (see https://helixr1107v0xdeko0k025g8.blob.core.windows.net/xharness-master-6bc91809e7094b48b7/ios-device-System.Buffers.Tests.app/1/list-ios-device-20250203_082615.log?helixlogtype=result)

Image

Is there some device configuration option we need to set for the lab devices to make this work or could this be an issue with mlaunch itself?

(We tried replugging and repairing the devies numerous times without any success)


cc: @vitek-karas

@dalexsoto
Copy link
Member

This sounds like developer mode on device is not enabled https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device

@rolfbjarne
Copy link
Member

Can you run this:

xcrun devicectl list devices -v --json-output devices.json

and then attach the resulting devices.json file?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Feb 10, 2025
@rolfbjarne rolfbjarne added this to the Future milestone Feb 10, 2025
@matouskozak
Copy link
Author

matouskozak commented Feb 11, 2025

Thank you @dalexsoto and @rolfbjarne.

This sounds like developer mode on device is not enabled https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device

I don't have direct access to the device but I checked Xcode -> Window -> Devices and Simulators and there is no warning about disabled developer mode. Additionally, the following log suggest that developer mode is enabled.

Can you run this:
xcrun devicectl list devices -v --json-output devices.json
and then attach the resulting devices.json file?

It is a bit difficult to get any files from the lab device manually, I'll try to figure it out. However, I think that similar output can be found from https://helixr1107v0xdeko0k025g8.blob.core.windows.net/xharness-master-6bc91809e7094b48b7/ios-device-System.Buffers.Tests.app/1/list-ios-device-20250203_082615.log?helixlogtype=result , not in json format thought. Let me know if you would need the json specifically.

[08:26:16.2080330] xcrun devicectl -j /tmp/helix/working/A8760923/t/tmpVjAM2t.tmp -v list devices
[08:26:20.0292430] 	Running devicectl with elevated privileges via sudo is unlikely to work properly. Please do not do this.
[08:26:23.1585510] 	Using verbose logging.
[08:26:23.1586150] 	Devices:
[08:26:23.1672640] 	  ▿ 1 element
[08:26:23.1673090] 	    ▿ CoreDeviceClientJSONSupport.DeviceResult
[08:26:23.1673240] 	      - identifier: 3D048AED-F823-4530-A0E8-D1D1C16F9948
[08:26:23.1673340] 	      - tags: 0 elements
[08:26:23.1674510] 	      ▿ hardwareProperties: CoreDeviceClientJSONSupport.DeviceResult.HardwareProperties
[08:26:23.1674750] 	        ▿ cpuType: Optional(CoreDeviceClientJSONSupport.DeviceResult.CPUInfo(type: 16777228, subType: 2, name: "arm64e"))
[08:26:23.1674860] 	          ▿ some: CoreDeviceClientJSONSupport.DeviceResult.CPUInfo
[08:26:23.1674970] 	            - type: 16777228
[08:26:23.1675060] 	            - subType: 2
[08:26:23.1675160] 	            - name: "arm64e"
[08:26:23.1675880] 	        ▿ deviceType: Optional("iPhone")
[08:26:23.1676060] 	          - some: "iPhone"
[08:26:23.1676170] 	        ▿ ecid: Optional(886086987628590)
[08:26:23.1676270] 	          - some: 886086987628590
[08:26:23.1676370] 	        ▿ hardwareModel: Optional("D79AP")
[08:26:23.1676480] 	          - some: "D79AP"
[08:26:23.1676750] 	        ▿ internalStorageCapacity: Optional(64000000000)
[08:26:23.1676880] 	          - some: 64000000000
[08:26:23.1676970] 	        ▿ isProductionFused: Optional(true)
[08:26:23.1677100] 	          - some: true
[08:26:23.1678200] 	        ▿ marketingName: Optional("iPhone SE")
[08:26:23.1678410] 	          - some: "iPhone SE"
[08:26:23.1678530] 	        ▿ platform: Optional("iOS")
[08:26:23.1678630] 	          - some: "iOS"
[08:26:23.1678730] 	        ▿ productType: Optional("iPhone12,8")
[08:26:23.1678830] 	          - some: "iPhone12,8"
[08:26:23.1678930] 	        ▿ reality: Optional(CoreDeviceClientJSONSupport.DeviceResult.DeviceReality.physical)
[08:26:23.1679050] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.DeviceReality.physical
[08:26:23.1679150] 	        ▿ serialNumber: Optional("FFMGXY78PLJM")
[08:26:23.1679250] 	          - some: "FFMGXY78PLJM"
[08:26:23.1679680] 	        ▿ supportedCPUTypes: Optional([CoreDeviceClientJSONSupport.DeviceResult.CPUInfo(type: 16777228, subType: 2, name: "arm64e"), CoreDeviceClientJSONSupport.DeviceResult.CPUInfo(type: 16777228, subType: 0, name: "arm64"), CoreDeviceClientJSONSupport.DeviceResult.CPUInfo(type: 16777228, subType: 1, name: "arm64"), CoreDeviceClientJSONSupport.DeviceResult.CPUInfo(type: 33554444, subType: 1, name: "arm64_32")])
[08:26:23.1679830] 	          ▿ some: 4 elements
[08:26:23.1679930] 	            ▿ CoreDeviceClientJSONSupport.DeviceResult.CPUInfo
[08:26:23.1680030] 	              - type: 16777228
[08:26:23.1680120] 	              - subType: 2
[08:26:23.1680220] 	              - name: "arm64e"
[08:26:23.1680310] 	            ▿ CoreDeviceClientJSONSupport.DeviceResult.CPUInfo
[08:26:23.1680690] 	              - type: 16777228
[08:26:23.1680790] 	              - subType: 0
[08:26:23.1680910] 	              - name: "arm64"
[08:26:23.1680980] 	            ▿ CoreDeviceClientJSONSupport.DeviceResult.CPUInfo
[08:26:23.1681050] 	              - type: 16777228
[08:26:23.1681120] 	              - subType: 1
[08:26:23.1681180] 	              - name: "arm64"
[08:26:23.1681250] 	            ▿ CoreDeviceClientJSONSupport.DeviceResult.CPUInfo
[08:26:23.1681320] 	              - type: 33554444
[08:26:23.1681380] 	              - subType: 1
[08:26:23.1681450] 	              - name: "arm64_32"
[08:26:23.1681510] 	        ▿ supportedDeviceFamilies: Optional([1])
[08:26:23.1681580] 	          ▿ some: 1 element
[08:26:23.1681800] 	            - 1
[08:26:23.1681890] 	        ▿ thinningProductType: Optional("iPhone12,8")
[08:26:23.1682080] 	          - some: "iPhone12,8"
[08:26:23.1682150] 	        ▿ udid: Optional("00008030-000325E43423402E")
[08:26:23.1682230] 	          - some: "00008030-000325E43423402E"
[08:26:23.1682290] 	      ▿ deviceProperties: CoreDeviceClientJSONSupport.DeviceResult.DeviceProperties
[08:26:23.1682370] 	        - bootState: nil
[08:26:23.1682430] 	        - ddiServicesAvailable: false
[08:26:23.1682500] 	        ▿ developerModeStatus: Optional(CoreDeviceClientJSONSupport.DeviceResult.DeveloperModeStatus.enabled)
[08:26:23.1682570] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.DeveloperModeStatus.enabled
[08:26:23.1682640] 	        ▿ hasInternalOSBuild: Optional(false)
[08:26:23.1682710] 	          - some: false
[08:26:23.1682770] 	        ▿ name: Optional("Dncengosx160")
[08:26:23.1682840] 	          - some: "Dncengosx160"
[08:26:23.1682910] 	        ▿ osBuildUpdate: Optional("22B91")
[08:26:23.1682980] 	          - some: "22B91"
[08:26:23.1683040] 	        ▿ osVersionNumber: Optional("18.1.1")
[08:26:23.1683110] 	          - some: "18.1.1"
[08:26:23.1683180] 	        - provider: nil
[08:26:23.1683250] 	        - providerSpecificValues: nil
[08:26:23.1683400] 	        ▿ rootFileSystemIsWritable: Optional(false)
[08:26:23.1683470] 	          - some: false
[08:26:23.1683660] 	        - screenViewingURL: nil
[08:26:23.1683750] 	        ▿ bootedFromSnapshot: Optional(true)
[08:26:23.1683820] 	          - some: true
[08:26:23.1683890] 	        ▿ bootedSnapshotName: Optional("com.apple.os.update-4CD9F0831C05CA2895052E0364B14852F9B8CBA00CFD799C3DC2D9CE5F488FE8")
[08:26:23.1683960] 	          - some: "com.apple.os.update-4CD9F0831C05CA2895052E0364B14852F9B8CBA00CFD799C3DC2D9CE5F488FE8"
[08:26:23.1684030] 	        - releaseType: nil
[08:26:23.1684160] 	      ▿ connectionProperties: CoreDeviceClientJSONSupport.DeviceResult.ConnectionProperties
[08:26:23.1684240] 	        ▿ authenticationType: Optional(CoreDeviceClientJSONSupport.DeviceResult.AuthenticationType.manualPairing)
[08:26:23.1684310] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.AuthenticationType.manualPairing
[08:26:23.1684380] 	        - isMobileDeviceOnly: false
[08:26:23.1684440] 	        ▿ lastConnectionDate: Optional(2024-12-19 07:50:29 +0000)
[08:26:23.1684510] 	          ▿ some: 2024-12-19 07:50:29 +0000
[08:26:23.1684580] 	            - timeIntervalSinceReferenceDate: 756287429.5689731
[08:26:23.1684640] 	        - localHostnames: nil
[08:26:23.1684830] 	        ▿ potentialHostnames: Optional(["00008030-000325E43423402E.coredevice.local", "3D048AED-F823-4530-A0E8-D1D1C16F9948.coredevice.local"])
[08:26:23.1684920] 	          ▿ some: 2 elements
[08:26:23.1685150] 	            - "00008030-000325E43423402E.coredevice.local"
[08:26:23.1685230] 	            - "3D048AED-F823-4530-A0E8-D1D1C16F9948.coredevice.local"
[08:26:23.1685300] 	        ▿ pairingState: Optional(CoreDeviceClientJSONSupport.DeviceResult.PairingState.paired)
[08:26:23.1685370] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.PairingState.paired
[08:26:23.1685440] 	        ▿ transportType: Optional(CoreDeviceClientJSONSupport.DeviceResult.TransportType.wired)
[08:26:23.1685630] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.TransportType.wired
[08:26:23.1685730] 	        ▿ tunnelTransportProtocol: Optional(CoreDeviceClientJSONSupport.DeviceResult.TunnelTransportProtocol.tcp)
[08:26:23.1685800] 	          - some: CoreDeviceClientJSONSupport.DeviceResult.TunnelTransportProtocol.tcp
[08:26:23.1685870] 	        - tunnelIPAddress: nil
[08:26:23.1685940] 	        - tunnelState: CoreDeviceClientJSONSupport.DeviceResult.TunnelState.disconnected
[08:26:23.1686000] 	      ▿ capabilities: 3 elements
[08:26:23.1686070] 	        ▿ Acquire Usage Assertion (com.apple.coredevice.feature.acquireusageassertion)
[08:26:23.1686290] 	          - name: "Acquire Usage Assertion"
[08:26:23.1686390] 	          - featureIdentifier: "com.apple.coredevice.feature.acquireusageassertion"
[08:26:23.1686460] 	        ▿ Connect to Device (com.apple.coredevice.feature.connectdevice)
[08:26:23.1686520] 	          - name: "Connect to Device"
[08:26:23.1686590] 	          - featureIdentifier: "com.apple.coredevice.feature.connectdevice"
[08:26:23.1686650] 	        ▿ Unpair Device (com.apple.coredevice.feature.unpairdevice)
[08:26:23.1686720] 	          - name: "Unpair Device"
[08:26:23.1686790] 	          - featureIdentifier: "com.apple.coredevice.feature.unpairdevice"
[08:26:23.1686850] 	      ▿ visibilityClass: Optional(CoreDeviceClientJSONSupport.DeviceResult.DeviceVisibilityClass.default)
[08:26:23.1686920] 	        - some: CoreDeviceClientJSONSupport.DeviceResult.DeviceVisibilityClass.default
[08:26:23.1706290] 	Saving JSON output file to /tmp/helix/working/A8760923/t/tmpVjAM2t.tmp

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Feb 11, 2025
@rolfbjarne
Copy link
Member

It looks like we don't write a value for IsUsableForDebugging to the output xml when listing devices found using devicectl.

Fix in progress: https://dev.azure.com/devdiv/DevDiv/_git/macios-mlaunch/pullrequest/610825

@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix mlaunch and removed need-attention An issue requires our attention/response labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix mlaunch
Projects
None yet
Development

No branches or pull requests

3 participants