java中调用adb shell 命令启动android应用程序
2014-03-20 11:01
471 查看
先把adb shell命令做成bat文件,然后再程序中调用即可,
adb shell am start -n com.sankuai.meituan/com.sankuai.meituan.activity.Welcome
exit
下面代码在手机上测试通过
adb shell am start -n com.sankuai.meituan/com.sankuai.meituan.activity.Welcome
exit
下面代码在手机上测试通过
/* * 启动应用程序 */ public void startActivity(String pakageName,String activityName){ try{ // Process p = Runtime.getRuntime().exec("cmd.exe /c start" + // "D:\\360安全浏览器下载\\startActivity.bat"); // Process p = Runtime.getRuntime().exec("adb shell " ); // p.waitFor(); Process q = Runtime.getRuntime().exec("cmd.exe /c start D:\\360安全浏览器下载\\startActivity.bat" );
//等待程序启动 Thread.sleep(1000); q.waitFor(); }catch(Exception e){ }
相关文章推荐
- java中调用adb shell 命令启动android应用程序
- adb shell 启动,停止 android 应用程序
- 在windows下使用cmd命令通过adb shell自动调用android模拟或真机的InstrumentRunner进行android 自动化测试
- Android 通过adb shell命令查看内存,CPU,启动时间,电量等信息
- Android adb shell启动应用程序的方法
- android如何用adb shell启动应用程序
- adb shell 启动,停止 android 应用程序
- 【Android】通过adb shell命令查看内存,CPU,启动时间,电量等信息
- 通过adb命令在Android设备中执行Java命令, 并调用so文件。
- java调用android aapt反编译命令获取应用程序包名和应用名
- adb shell 启动,停止 android 应用程序
- 使用Android adb命令来启动Android应用程序
- adb shell 命令查看android 应用程序 创建的 sqlite 数据库
- Android 通过adb shell命令查看内存,CPU,启动时间,电量等信息
- execlp启动android进程命令窗口通过adb shell 进入android 的Linux命令界面,输入am -help看到如下信息: 我们可以通过命令启动android中的
- [原创] adb shell 启动,停止 android 应用程序
- Android使用adb命令启动应用程序时碰到的问题!( android:exported)
- android java程序中调用shell命令
- 使用Android adb命令来启动Android应用程序
- 使用Android adb命令来启动Android应用程序