dryark / ios_remote_provider

Other
49 stars 33 forks source link

ios_remote_provider fails when plug in fourth device #42

Closed aslozhkin closed 3 years ago

aslozhkin commented 3 years ago

@nanoscopic Hi! I have 3 devices working correctly (iPhone 12 mini iOS 14.4, iPhone SE2020 iOS 13.5, iPhone 7 iOS 14.2). When i plug in 4-th device (iPhone 7 iOS 13.5) im getting: Got incoming frame 1800 Got incoming frame 1830 Got incoming frame 1530 Got incoming frame 1860 Creating IIFDev with udid=ebae5996691577635130b1900ebf4b261ac5ec18 udid: ebae5996691577635130b1900ebf4b261ac5ec18 Running bin/iosif [mg -json -id ebae5996691577635130b1900ebf4b261ac5ec18 AvailableDisplayZoomSizes main-screen-width main-screen-height ArtworkTraits] json:{ "AvailableDisplayZoomSizes":{ default:[ 2 375 2 667 ] zoomed:[ 2 320 2 568 ] } , "main-screen-width":750 , "main-screen-height":1334 , "ArtworkTraits":{ ArtworkDeviceIdiom:"phone" ArtworkDeviceSubType:569 CompatibleDeviceFallback:"iPhone8,1" GraphicsFeatureSetFallbacks:"APPLE3v1:APPLE2:APPLE1:GLES2,0" ArtworkDisplayGamut:"P3" ArtworkDeviceProductDescription:"iPhone 7" ArtworkDynamicDisplayMode:"0" GraphicsFeatureSetClass:"APPLE3" ArtworkDeviceScaleFactor:2 DevicePerformanceMemoryClass:2 }

}

Notified control floor of 'device existence'; uuid=***ec18 panic: runtime error: slice bounds out of range [1:0]

goroutine 35 [running]: main.(DeviceTracker).getPort(0xc0000be000, 0xc0003408c0) /Users/mcloud/ios_remote_provider/device_tracker.go:73 +0xf9 main.NewDevice(0xc000206000, 0xc0000be000, 0xc0001a0090, 0x28, 0x44b2dc0, 0xc00034e000, 0xc0003570f8) /Users/mcloud/ios_remote_provider/device.go:75 +0x65 main.(DeviceTracker).onDeviceConnect(0xc0000be000, 0xc0001a0090, 0x28, 0x44b2dc0, 0xc00034e000, 0x177) /Users/mcloud/ios_remote_provider/device_tracker.go:180 +0xcb main.(DeviceTracker).onDeviceConnect1(0xc0000be000, 0x44b2dc0, 0xc00034e000, 0x0) /Users/mcloud/ios_remote_provider/device_tracker.go:133 +0x58c main.NewDeviceTracker.func1(0x44b2dc0, 0xc00034e000, 0xc0001a0090, 0x28) /Users/mcloud/ios_remote_provider/device_tracker.go:46 +0x3e main.(IIFBridge).OnConnect(0xc0000c4000, 0xc0001a0090, 0x28, 0xc00030a1a0, 0x17, 0xc0000be0e0) /Users/mcloud/ios_remote_provider/bridge_iif.go:95 +0xc8 main.(*IIFBridge).startDetect.func2(0xc00007ed80, 0x5f, 0xc0000be0e0) /Users/mcloud/ios_remote_provider/bridge_iif.go:71 +0x29a main.proc_generic.func1(0xc0000be0e0, 0xc0000ac2a0, 0xc0000b8100, 0xc0000ac1b0, 0xc0000ac270, 0xc0000bc060, 0xc0000a8038, 0x0, 0x0) /Users/mcloud/ios_remote_provider/proc_generic.go:194 +0xdab created by main.proc_generic /Users/mcloud/ios_remote_provider/proc_generic.go:109 +0x669

I added device specific configuration with the width/height of the device in config.json

sonusainier commented 3 years ago

can you please share the config.json ??

aslozhkin commented 3 years ago

can you please share the config.json ??

{ controlfloor: { host: "192.168.88.204:8080" username: "first" https: true selfSigned: true } wda: { devTeamOu: "my_dev_team_ou" bundleIdPrefix: "com.appium" runner: { buildStyle: "Automatic" // or "Manual" provisioningProfile: "" // specify when buildStyle is Manual } startMethod: "tidevice" }, vidapp: { devTeamOu: "my_dev_team_ou" bundleIdPrefix: "com.dryark" }, devices: [ { udid:"c1fdd587a8a71baa208650daee9951ddc5e1003d" uiWidth:375 uiHeight:667 }, { udid:"ebae5996691577635130b1900ebf4b261ac5ec18" uiWidth:375 uiHeight:667 }, { udid:"00008030-001454190EEB802E" uiWidth:375 uiHeight:667 }, { udid:"00008101-00125D080112001E" uiWidth:375 uiHeight:812 }, { udid:"70df7dabfb451d77c1f061b3ee2f0729a4fcb3af" uiWidth:768 uiHeight:1024 } ] }

nanoscopic commented 3 years ago

This is just due to the automatic local port allocation being hardcoded with not enough ports to handle more devices. I need to update this bit of code to use a much larger range.

After update it should work fine. I'll do it tomorrow.

aslozhkin commented 3 years ago

This is just due to the automatic local port allocation being hardcoded with not enough ports to handle more devices. I need to update this bit of code to use a much larger range.

After update it should work fine. I'll do it tomorrow.

Thank you!

nanoscopic commented 3 years ago

I'm changing the code more heavily than I said I would to use a range and also to support specifying a manual port allocation for the WDA port for specific devices. Will commit/push the updates soon.

nanoscopic commented 3 years ago

Ports now use a range instead of a fixed set, which resolves this problem.