Android installing apk to device gives [SEGMENTATION FAULT]

拟墨画扇 提交于 2020-01-02 05:29:06

问题


i have a problem. When i am trying to deploy (Debug or Run) my App with the AndroidStudio, i get the following error in the RunLog

Waiting for device.
Target device: samsung-galaxy_nexus-WOVCBUF6BAGENRTO
Uploading file
    local path: C:\Users\Abracadabra\Desktop\......\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/xxx.xxx.app
Installing xxx.xxx.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/xxx.xxx.app"

Segmentation fault

It works fine when i try to deploy it to the genymotion VM. It just does not work on my real device. It did work before, but i have cleaned up some folders there with the rootExplorer, for example i deleted a folder called ".Idea". Maybe this was a big mistake? Is this the reason why it does not work anymore?

By the way, logcat is working fine for the rest of the phone.

Thanks for any help!

P.S. I also installed a fresh android with the CWM recovery tool and wiped all user and cache data -> did not help.

P.P.S I found out, that the apk is in /data/local/tmp on the phone. I can install it manually with the rootExplorer. but debugging is also not possible :/

P.P.P.S: I also have tried "adb install", also gives me segmentation fault.

It seems that copy is possible, but installation not.


回答1:


Found out the reason. (a quite stupid one)

I forgot to enable "Security Settings -> Unknown Sources"




回答2:


I encountered the same problem.

Waiting for device.
Target device: samsung-gt_n7100-4df180b77e139fdd
Uploading file
    local path: C:\Users\Harshal\AndroidStudioProjects\MyFirstApp\CurrentAffairs\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/com.softcode.anupreet.currentaffairs
Installing com.softcode.anupreet.currentaffairs
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"
Segmentation fault

I downloaded the 'Terminal Emulator' app on my device and ran the below two commands, it was a success.

su -o pm install -r "/data/local/tmp/com.softcode.anupreet.currentaffairs"


来源:https://stackoverflow.com/questions/24245986/android-installing-apk-to-device-gives-segmentation-fault

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!