1. 程式人生 > 其它 >安卓模擬器使用記錄

安卓模擬器使用記錄

安卓模擬器主要就2種類型(windows上執行),
一種是原生的sdk,真正模擬真機,如genymotion(基於virtualbox)和androidstudio(基於android sdk);
一種是把android 底層的api介面翻譯成windows api,調的其實是windows系統的介面,如騰訊手遊助手,夜神模擬器,雷電模擬器,藍疊模擬器等,且特定版本都是特定android版本,不能選擇android版本.

andriod studio 模擬器(android 8.0.0 X86,X86_64)安裝apk報錯:could not parse error string

genymotion 模擬器安裝apk報錯:An error orrucred while deploying the file.This probably meas that the app contains ARM native and your Genymotion device cannot run ARM instructions.You should either build your native code to x86 or install an ARM translation tool in your device.

查資料https://www.cnblogs.com/liyanli-mu640065/p/9970097.html 是因為要安裝的apk限制了只能在ARM架構的CPU機器上,但是模擬器用的是X86,或X86_64架構

Device supports x86,but Apk only supports armeabi-v7a
首先了解了CPU架構:
armeabi :第5代 ARM v5TE,使用軟體浮點運算,相容所有ARM裝置,通用性強,速度慢
armeabi-v7a: 第7代 ARM v7,使用硬體浮點運算,具有高階擴充套件功能
arm64-v8a :第8代,64位,包含AArch32、AArch64兩個執行狀態對應32、64bit
x86: intel 32位,一般用於平板
x86_64: intel 64位,一般用於平板
mips: RISC處理器

mips64:RISC處理器

我們可以在build.gradle中有ndk這段程式碼,只要在後面加上“x86”,再sync now一下,就發現可以運行了。

ndk {
abiFilters "armeabi-v7a","x86"
}