如何在Android Studio中的模拟器上安装apk? [英] How to install an apk on the emulator in Android Studio?
问题描述
如何从终端在Android Studio中的模拟器上安装apk?
How do you install an apk on the emulator in Android Studio from the terminal?
在Eclipse中,我们做了
In Eclipse we did
/home/pcname/android-sdks/platform-tools/adb -s emulator-5554 install /home/pcname/Downloads/apkname.apk
现在在Android Studio中怎么样?
Now how about in Android Studio?
推荐答案
编辑:尽管此答案被标记为正确答案(在2013年),但目前由下面的@ user2511630回答,您可以将apk文件直接拖放到仿真器中以进行安装.
Even though this answer is marked as the correct answer (in 2013), currently, as answered by @user2511630 below, you can drag-n-drop apk files directly into the emulator to install them.
原始答案:
无论您使用什么(Eclipse或Android Studio),都可以安装 .apk 文件来仿真.
You can install .apk files to emulator regardless of what you are using (Eclipse or Android Studio)
这是我一直在做的:(适用于初学者)
here's what I always do: (For full beginners)
1-运行模拟器,并等待其完全启动.
1- Run the emulator, and wait until it's completely started.
2-转到您的 sdk 安装文件夹,然后转到 platform-tools (您应该会看到一个名为 adb.exe 的可执行文件)
2- Go to your sdk installation folder then go to platform-tools (you should see an executable called adb.exe)
3-创建一个新文件,并将其命名为 run.bat ,用记事本编辑该文件,并在其中写入 CMD 并保存.
3- create a new file and call it run.bat, edit the file with notepad and write CMD in it and save it.
4-将所需的APK复制到同一文件夹
4- copy your desired apk to the same folder
5-现在打开run.bat并输入 adb install "your_apk_file.apk"
5- now open run.bat and write adb install "your_apk_file.apk"
6-等待安装完成
7-瞧,您的apk已安装到模拟器中.
7- voila your apk is installed to your emulator.
注意:如果已经存在,请使用 adb install -r "your_apk_file.apk"
Note: to re-install the application if it already existe use adb install -r "your_apk_file.apk"
对不起,我对全部初学者说的详细说明
sorry for the detailed instruction as I said for full beginners
希望获得帮助.
关于
Tarek
这篇关于如何在Android Studio中的模拟器上安装apk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!