ws-scrcpy icon indicating copy to clipboard operation
ws-scrcpy copied to clipboard

Support linux/window host for ios devices

Open drauggres opened this issue 2 years ago • 2 comments

Discussed in https://github.com/NetrisTV/ws-scrcpy/discussions/194

Originally posted by wanliLiu April 9, 2022 currently ios device detect use lib ios-device-lib, and this lib can only run in mac or windows,not run in Linux. as for run xctest use appium default way xcodebuild, so , all of this lead to cannot run in linux.

and this lib tidevice can fix it, use tidevice list fix ios device detect, and run xctest use tidevice xctest -B com.facebook.wda.WebDriverAgent.Runner, thus ,because it wirted in python, so it can run in mac windows and linux. I have done all of this in this project,it works,

by the way, video stream use mjpeg

drauggres avatar Apr 09 '22 08:04 drauggres

new SubpPocess("tidevice",["-u",options.serial, "xctest", "-B","com.apple.test.W ebDriverAgentRunner-Runner"])

Can be added to webdriveragentrunner file, also increases speed of ios loading by 10x times

krishtoautomate avatar Aug 28 '22 02:08 krishtoautomate

extends ProcessRunner<ProcessRunnerEvents> {

can be used to implement tidevice similar to ws-qvh.

existing xcuitest driver can be reused with below changes as xcode build is not required

        await server.driver.createSession({
            platformName: 'iOS',
            deviceName: 'my iphone',
            udid: this.udid,
            wdaLocalPort: this.wdaLocalPort,
            usePrebuiltWDA: true,
            mjpegServerPort: remoteMjpegServerPort,
            webDriverAgentUrl: "http://127.0.0.1:"+this.wdaLocalPort
        });
        // await server.driver.wda.xcodebuild.waitForStart(new timing.Timer().start());
        // if (server.driver?.wda?.xcodebuild?.xcodebuild) {
        //     server.driver.wda.xcodebuild.xcodebuild.on('exit', (code: number) => {
        //         this.started = false;
        //         this.starting = false;
        //         server.driver.deleteSession();
        //         delete this.server;
        //         this.emit('status-change', { status: 'stopped', code });
        //         if (this.holders > 0) {
        //             this.start();
        //         }
        //     });
        // } else {
        //     this.started = false;
        //     this.starting = false;
        //     delete this.server;
        //     throw new Error('xcodebuild process not found');
        // }

krishtoautomate avatar Aug 30 '22 03:08 krishtoautomate