在没有模拟器的外部设备上安装 sqlite3 [英] Installing sqlite3 on an external device without emulator

查看:35
本文介绍了在没有模拟器的外部设备上安装 sqlite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名学生,我想了解如何在 android 上使用 sqlite3.我的朋友尝试运行 android 模拟器并开始输入命令 adb -e shellsu,浏览模拟器存储,然后运行 ​​sqlite3 mydb.db.一切都很顺利.但是每当我们尝试使用外部物理 android 设备运行 adb 时,运行 sqlite mydb.db 都是一个问题.ADB 无法找到 sqlite 可执行文件.我已经 root 了我的设备并授予了 adb 权限,但它似乎仍然没有找到 sqlite 可执行文件.

I am a student and I want to learn about using sqlite3 on android. My friend tried to run the android emulator and start typing commands adb -e shell, su, navigated through the emulator storage, then run sqlite3 mydb.db. Everything went fine. But whenever we tried running adb with the use of an external physical android device, running sqlite mydb.db is a problem. ADB cannot somewhat find the sqlite executable. I already rooted my device and granted permission the adb but still it doesn't seem to find the sqlite executable.

我做了一些研究.我在另一个 post 一些 android 设备没有内置 sqlite.所以我尝试研究任何可能的方法在 android 系统上安装 sqlite3.我找到了这个.答案之一建议这个.我已经试过了,但安装程序对我不起作用.在同一问题中,选定的答案是从模拟器(支持一个模拟器)中提取 sqlite 并将其推送到我的设备.

I did some research. I found out in another post that some of android devices do not have sqlite built in. So I tried researching for any possible ways to install sqlite3 on android system. I found this. One of the answers suggested this. I already tried but The installer doesn't work for me. In the same question, the selected answer is to pull sqlite from an emulator (that supports one) and push it to my device.

这种方法的问题是我们的资源有限.我正在使用的笔记本电脑只有 1 GHz CPU 和 3 GB RAM.由于我的 CPU 速度,Android Studio 甚至不允许我运行模拟器.从可以运行模拟器(可以用 sqlite3 模拟设备)的更快更好的笔记本电脑复制只是我最后也是最后的选择.还有其他办法吗?

The problem with this method is we have limited amount of resources. The laptop I'm working on has only 1 GHz CPU and 3 GB RAM. Android Studio won't even let me run an emulator because of the speed of my CPU. Copying from a faster and better laptop that can run emulator (that can emulate device with sqlite3) is only my last and very final option. Is there any other way?

推荐答案

对于未来的学生,我会回答这个问题

For future students I'll answer this question

下载这里为android编译的sqlite3

Download here compiled sqlite3 for android

通过adb push sqlite3/data/local/tmp

通过 adb shell && 授予执行权限cd/data/local/tmp &&chmod +X sqlite3

然后运行

/data/local/tmp/sqlite3/data/data/com.app/databases/some_database.db "SELECT name FROM sqlite_master WHERE type='table'"

这篇关于在没有模拟器的外部设备上安装 sqlite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆