我终于设法混淆了我的Android应用程序,现在我想通过安装APK文件并在模拟器上运行来测试它。

如何在Android Emulator上安装APK文件?


当前回答

在命令提示符下转到androidsdk/tools目录,然后键入

 adb install fileName.apk (Windows)

 ./adb install fileName.apk (Linux or Mac)

其他回答

在终端/cmd上编写命令adb安装文件名.apk。

转到Shell/Terminal/,然后到达androidsdk/tools目录

adb install fileName.apk // (u can run this command on windows)
or 
./adb install fileName.apk  //( u can run this command on linux)

在mac或windows中。只需运行模拟器并在主屏幕上拖放apk。它将安装

如果你已经创建了多个仿真器,或者你已经插入了Android设备,adb会抱怨

error: more than one device and emulator

adb帮助并不十分清楚该做什么:

-d                        - directs command to the only connected USB device...
-e                        - directs command to the only running emulator...
-s <serial number>        ...
-p <product name or path> ...

您决定使用的标志必须位于实际adb命令之前:

adb -e install path/to/app.apk

在Genymotion中,只需将*.apk文件拖放到模拟器中,它就会自动安装并运行。

http://www.genymotion.com/