命令行启动android emulator及用adb加载应用程序 .

1.创建一个手机模拟环境

        1.1启动android-sdk-linux/tools/android->tool->manage AVD创建一个模拟环境,命名为test

2.命令行下启动模拟器

        android-sdk-linux/tools/emulator -avd test

3.adb连接到设备

        android-sdk-linux/platform-tools/adb connect 127.0.0.1:5554(5554是虚拟设备启动后的监听端口)

        android-sdk-linux/platform-tools/adb kill-server

        android-sdk-linux/platform-tools/adb disconnect 127.0.0.1:5554

4.adb安装软件

        android-sdk-linux/platform-tools/adb install /home/shuyong/gitroot/shuyong1999.project/trunk/app/Learning/android/HelloAndriod/bin/HelloAndriod-debug.apk(安装包路径)

        in/HelloAndriod-debug.apk
        71 KB/s (4397 bytes in 0.059s)
        pkg: /data/local/tmp/HelloAndriod-debug.apk
        Success


        如果安装时提示错误信息:Failure [INSTALL_FAILED_ALREADY_EXISTS]则表示已经安装了

5.卸载软件

        android-sdk-linux/platform-tools/adb uninstall android.test(包名)

6.进入手机模拟器的shell环境

        android-sdk-linux/platform-tools/adb shell           

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值