PHP code example of ladit / ajoystick

1. Go to this page and download the library: Download ladit/ajoystick library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ladit / ajoystick example snippets



use Ajoystick\Device;

$element = Device::singleton()->waitUntil(function () {
    $element = Device::singleton()->findElementById('element-id');
    if ($element) return [true, $element];
    return [false, null];
});
$element->tap();
Device::singleton()->swipeUp();
Device::singleton()->screenshotAndSaveTo('.');