Skip to content

Conversation

wenerme
Copy link
Contributor

@wenerme wenerme commented Jun 6, 2025

No description provided.

@krismuhi
Copy link
Member

krismuhi commented Jun 6, 2025

thanks for the submission! we are reviewing this

@gmegidish
Copy link
Member

Hey @wenerme thanks for this pull request!!

  1. Why is there a need to parse the out of the stdout response? are you getting other text prepended to the itself? what platform and os?

  2. I see how using process.env.MOBILE_MCP_DEVICE_ID can speed up development a bit, since the LLM doesn't need to call list_devices first. I believe this is a short term improvement. I rather have the LLM be faster, have caching, or have a good prompt (like "use the iphone device"). I see this prone to problems, especially if you have more than one device connected. And if you have one, just have it pick the only device connected.

wdyt?

@wenerme
Copy link
Contributor Author

wenerme commented Jun 12, 2025

@gmegidish

  1. macOS, android, the dump may throw exception like
<init>java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml: open failed: ENOENT (No such file or directory)
  1. MOBILE_MCP_DEVICE_ID is mostly for speed up development, using instector to dev mcp, eveny time I have to invoke the use device and copy paste the id, it's ok to remove this. but some times I do see llm will invoke the use_device in second run, the first run will errorout, this may reduce two tool invoke.

@gmegidish
Copy link
Member

@wenerme are you willing to submit only the android.ts file?

I have now pushing a new change that supports program arguments like "--port 10000". We can add limit there, instead of configuring it through environment. It'll make it easier for other integrations of the mcp.

Also, I'm thinking of changing the code so if there's only one device connected, it will assume that. but if there are multiple, it's going to tell the LLM to choose a device first. What do you think of this change?

@wenerme
Copy link
Contributor Author

wenerme commented Jun 13, 2025

submit only the android.ts file
done

if there's only one device connected, it will assume that. but if there are multiple, it's going to tell the LLM to choose a device first

this will work, default to first fallback to throw error with device ids

@gmegidish gmegidish merged commit b174531 into mobile-next:main Jun 16, 2025
1 check passed
@gmegidish
Copy link
Member

@wenerme thank you for debugging and sending this pull request. let's see how we automatically select if there's only one device and require use_device if 2 or more devices found. same logic that "adb shell" would have if there's 1 or 2+ devices connected. 🚀

@wenerme wenerme deleted the fix/android-xml branch June 16, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants