You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you only giving a very rough template of what to do to the model? It is like it is completely guessing the commands. I would expect there to at least be suggested command line program to use, and ideally a way to prevalidate the what is installed.
As is this seems like a great way to both waste Cursor requests, and time.
The am and shell commands should be prefixed with adb. monkey should be monkeyrunner. We should also have a way to explicitly tell the model what are valid commands. So it doesn't try to try to do something replace adb with monkey.
In general the code should be more like:
@mcp.tool()
def execute_adb_command(command: str) -> str:
"""Executes an ADB command and returns the output.
Args:
command (str): The ADB command to execute
Returns:
str: The output of the ADB command
"""
result = deviceManager.execute_adb_command(command)
return result
Examples from Claude 3.7 thinking:
}
"command": "shell am start -n me.ccrama.redditslide/me.ccrama.redditslide.Activities.MainActivity"
}
Thank you for raising this issue. I see the confusion and it's actually my fault for not naming the function more clearly.
Let me clarify how the execute_adb_command function works in adbdevicemanager.py:
defexecute_adb_command(self, command: str) ->str:
"""Executes an ADB command and returns the output."""ifcommand.startswith("adb shell "):
command=command[10:]
elifcommand.startswith("adb "):
command=command[4:]
result=self.device.shell(command)
returnresult
This function actually:
Takes any command string (with or without "adb" prefixes)
Strips the "adb shell" or "adb" prefix if present
Uses the ppadb client's device.shell() method to execute the command directly
The examples you pointed out from Claude's thinking are actually being processed correctly - whether or not they include the "adb" prefix, they get properly executed on the device.
I'll make sure to rename the function to execute_adb_shell_command
Are you only giving a very rough template of what to do to the model? It is like it is completely guessing the commands. I would expect there to at least be suggested command line program to use, and ideally a way to prevalidate the what is installed.
As is this seems like a great way to both waste
Cursor
requests, and time.The
am
andshell
commands should be prefixed withadb
.monkey
should bemonkeyrunner
. We should also have a way to explicitly tell the model what are valid commands. So it doesn't try to try to do something replaceadb
withmonkey
.In general the code should be more like:
Examples from
Claude 3.7 thinking
:The text was updated successfully, but these errors were encountered: