simulator_scroll_to
MCP टूल जो टीम के Simulator की स्क्रीन को तब तक scroll करता है जब तक कोई एलिमेंट दिखने न लगे, उसे टैप किए बिना।
simulator_scroll_to टीम के चल रहे Simulator को swipe दर swipe scroll करता है, जब तक कोई एलिमेंट पूरा स्क्रीन पर न आ जाए, फिर रुक जाता है। यह उसे टैप नहीं करता: इसके बाद simulator_tap इस्तेमाल करें। जो एलिमेंट पहले से स्क्रीन पर है, उसके लिए swipe की ज़रूरत नहीं। हर swipe scroll area का अधिकतम आधा हिस्सा हिलाता है और धीरे से छोड़ता है, ताकि सामग्री fling होकर एलिमेंट से आगे न निकल जाए। खोज तब खत्म होती है जब एलिमेंट दिखे, जब सामग्री हिलना बंद कर दे (सूची का अंत), maxScrolls swipes के बाद, या timeoutSeconds के बाद; विफल खोज स्क्रीन को scroll की हुई हालत में छोड़ सकती है। एक खोज अधिकतम 25 सेकंड चलती है: जारी रखने के लिए इसे फिर से कॉल करें।
direction बताता है कि सामग्री कहाँ है, यह नहीं कि उँगली किस ओर चलती है: down (डिफ़ॉल्ट) नीचे की चीज़ें दिखाता है, इसलिए उँगली ऊपर जाती है। जब स्क्रीन पर कई scroll areas हों, तो scroll करने वाले area को withinId या withinText से बताएँ: इसे ठीक एक दिखने वाले एलिमेंट से मेल खाना चाहिए।
| रीड-ओनली | डिस्ट्रक्टिव | आइडेम्पोटेंट |
|---|---|---|
| नहीं | नहीं | नहीं |
इनपुट
| इनपुट | टाइप | ज़रूरी | डिफ़ॉल्ट | यह क्या करता है |
|---|---|---|---|---|
teamId |
string (UUID) | हाँ | — | टीम, list_teams से |
simulator |
string | नहीं | टीम का डिफ़ॉल्ट डिवाइस | कौन-सा डिवाइस, list_simulators से मिले id से |
text |
string | text, id, nodeId में से एक |
— | एलिमेंट का दिखने वाला टेक्स्ट, जैसे सेलेक्टर में |
id |
string | text, id, nodeId में से एक |
— | एलिमेंट का accessibilityIdentifier |
nodeId |
string | text, id, nodeId में से एक |
— | simulator_describe_ui से मिला nodeId |
exact |
boolean | नहीं | false |
text बिल्कुल मेल खाना चाहिए |
direction |
string: down, up, left या right |
नहीं | down |
दिखाने वाली सामग्री कहाँ है |
withinId |
string | नहीं | पूरी स्क्रीन | scroll area, उसके accessibilityIdentifier से |
withinText |
string | नहीं | पूरी स्क्रीन | scroll area, उसके टेक्स्ट से |
withinExact |
boolean | नहीं | false |
withinText बिल्कुल मेल खाना चाहिए |
timeoutSeconds |
number, 0 से 25 | नहीं | 20 |
कितनी देर खोजना है, सेकंड में |
maxScrolls |
integer, 1 से 100 | नहीं | 25 |
अधिकतम कितने swipes करने हैं |
नतीजा
| फ़ील्ड | मतलब |
|---|---|
ok |
true |
element, point, exact, matchCount, excluded |
मिला हुआ एलिमेंट, जैसे simulator_tap में |
scrolls |
इसमें कितने swipes लगे |
elapsedMs |
इसमें कितना समय लगा, मिलीसेकंड में |
{ "ok": true, "element": { "label": "Settings", "role": "AXCell", "frame": { "x": 0, "y": 610, "width": 402, "height": 44 }, "enabled": true, "interactive": true, "adjustable": false },
"point": { "x": 201, "y": 632 }, "exact": true, "matchCount": 1, "excluded": [], "scrolls": 3, "elapsedMs": 4200 }त्रुटियाँ
| संदेश | कब | क्या करें |
|---|---|---|
| Name the element: text, id or nodeId. | तीनों में से कोई नहीं | एक जोड़ें |
| direction must be one of down, up, left, right. | कोई दूसरा direction |
चारों में से एक इस्तेमाल करें |
| scroll content stopped changing after n swipes without revealing selector; reached the end or the gesture did not scroll | सामग्री का अंत, या area scroll नहीं होता | दूसरा direction आज़माएँ, या scroll area बताएँ |
| selector not visible after n scroll attempts | maxScrolls पूरे हो गए |
फिर से कॉल करें, या maxScrolls बढ़ाएँ |
| scroll-to selector did not happen within ns | समय खत्म हो गया | जारी रखने के लिए फिर से कॉल करें |
| scroll container selector must match exactly one visible element (found n) | withinId / withinText किसी से मेल नहीं खाया या कई से खाया |
इसे और सटीक करें |
| max-scrolls must be between 1 and 100 | maxScrolls range के बाहर है |
1 से 100 भेजें |
साथ ही वे त्रुटियाँ जो हर Simulator टूल लौटा सकता है: देखें start_simulator।
उदाहरण
{"name": "simulator_scroll_to", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "text": "Settings", "direction": "down"}}