如何通过ADB调用com.seewo.easifinder执行交互白板.settings文件
问题描述
我有一个从Android交互白板导出的xxx.setting XML设置文件,需要通过ADB远程分发到多台同类型Clevertouch Impact Plus 2(Android 9)设备,并用com.seewo.easifinder包执行该文件。
已将文件上传至设备的/sdcard/mnt/Documents路径,手动点击文件会弹出覆盖当前设置的确认提示,但用ADB执行命令失败。尝试过的命令:
am start -n com.seewo.easifinder/.FileRetrieverActivity -d "content:/sdcard/mnt/Documents/xxxxx.setting"
执行后仅唤起文件选择对话框,并未执行目标文件。
以下是com.seewo.easifinder的Activity解析表:
Activity Resolver Table: Full MIME Types: application/xapk: 1c350b9 com.seewo.easifinder/.xapk.XApkInstallerActivity filter 670b80 Action: "android.intent.action.VIEW" Category: "android.intent.category.DEFAULT" Scheme: "file" Type: "application/xapk" */*: ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter 623e214 Action: "android.intent.action.GET_CONTENT" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter ba18abd Action: "android.intent.action.OPEN_DOCUMENT" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter 73bd8b2 Action: "android.intent.action.PICK" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true Base MIME Types: application: 1c350b9 com.seewo.easifinder/.xapk.XApkInstallerActivity filter 670b80 Action: "android.intent.action.VIEW" Category: "android.intent.category.DEFAULT" Scheme: "file" Type: "application/xapk" Wild MIME Types: *: ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter 623e214 Action: "android.intent.action.GET_CONTENT" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter ba18abd Action: "android.intent.action.OPEN_DOCUMENT" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true ad7ecfe com.seewo.easifinder/.FileRetrieverActivity filter 73bd8b2 Action: "android.intent.action.PICK" Category: "android.intent.category.DEFAULT" Category: "android.intent.category.OPENABLE" Type: "*" mPriority=0, mOrder=0, mHasPartialTypes=true Schemes: file: 1c350b9 com.seewo.easifinder/.xapk.XApkInstallerActivity filter 670b80 Action: "android.intent.action.VIEW" Category: "android.intent.category.DEFAULT" Scheme: "file" Type: "application/xapk" Non-Data Actions: android.intent.action.MAIN: 2997c5f com.seewo.easifinder/.FileBrowseMainActivity filter 19c3467 Action: "android.intent.action.MAIN" Category: "android.intent.category.DEFAULT"
解决方法
1. 修正Intent参数匹配手动触发逻辑
你当前调用的FileRetrieverActivity绑定的是GET_CONTENT/OPEN_DOCUMENT这类文件选择动作,所以只会唤起对话框。手动点击文件触发的是VIEW动作,需要调整命令参数:
- 使用
android.intent.action.VIEW动作 - 文件路径Scheme改为
file://(Android中本地文件的标准Scheme) - 优先让系统自动匹配处理
VIEW动作的Activity,而非指定FileRetrieverActivity
执行命令:
am start -a android.intent.action.VIEW -d "file:///sdcard/mnt/Documents/xxxxx.setting" -t "*/*"
如果系统默认用com.seewo.easifinder打开该文件,就会弹出覆盖设置的确认提示。
2. 确保文件权限可读取
应用可能因权限不足无法读取文件,执行以下命令修改权限:
adb shell chmod 644 /sdcard/mnt/Documents/xxxxx.setting
3. 批量分发脚本示例
如果需要批量处理多台设备,可以编写Shell脚本简化操作:
# 假设设备ID列表保存在devices.txt中,每行一个ID while read device_id; do # 推送文件到目标设备 adb -s $device_id push xxx.setting /sdcard/mnt/Documents/ # 设置文件可读权限 adb -s $device_id shell chmod 644 /sdcard/mnt/Documents/xxx.setting # 触发设置文件执行 adb -s $device_id shell am start -a android.intent.action.VIEW -d "file:///sdcard/mnt/Documents/xxx.setting" -t "*/*" done < devices.txt
4. 指定精准MIME类型(可选)
如果上述命令无效,可以先查询系统识别的.setting文件MIME类型:
adb shell mime type /sdcard/mnt/Documents/xxxxx.setting
若返回如application/xml这类具体类型,将命令中的-t "*/*"替换为对应类型:
am start -a android.intent.action.VIEW -d "file:///sdcard/mnt/Documents/xxxxx.setting" -t "application/xml"
内容的提问来源于stack exchange,提问作者user19902775
相关产品推荐
相关产品推荐

