Tôi đang cố gắng truy cập cơ sở dữ liệu SQLite từ dòng lệnh cho một ứng dụng Android mà tôi đã phát triển. Tôi nhập adb shell
để kết nối với thiết bị và sau đó sqlite3
để kết nối với cơ sở dữ liệu. sqlite3
mang lại cho tôi sau một lỗi: /system/bin/sh: sqlite3: không tìm thấyTruy cập cơ sở dữ liệu SQLite từ dòng lệnh
6
A
Trả lời
0
Hãy thử gõ "adb shell loại sqlite3" để xem liệu sqlite3 có sẵn trong điện thoại của bạn hay không.
Đối với điện thoại của tôi, nó hiển thị như sau
$ adb shell loại sqlite3 -> sqlite3 là một bí danh theo dõi trong/system/xbin/sqlite3
0
// Below code works on windows platform.. tried on windows 7 and windows 8
// This is vb script code.. save with .vb extention.
// any problems in saving.. please copy paste any vb file from ur system,take that second file ,open it with notepad and clear all contents, paste the below code as i did same.
// double click to run file. output shown will ur all tables. and u can continue with the own sql statements
// note : works with only one emulator. many emulator are supported.
// please dont try this code with mobile, you wont be able to access mobile database
// start of script
Set WshShell = WScript.CreateObject("WScript.Shell")
// set ur path to platform tools in ur sdk
strApp = "E:\Android\sdk\platform-tools"
arrPath = Split(strApp, "\")
For i = 0 to Ubound(arrPath)
strAppPath = strAppPath & arrPath(i) & "\"
Next
WshShell.CurrentDirectory = strAppPath
WshShell.Run ("cmd.exe")
WScript.Sleep 50
WshShell.SendKeys "adb shell"
WshShell.SendKeys "{ENTER}"
// put ur package name and database name over here. please put ur db name with .db extension
WshShell.SendKeys "sqlite3 /data/data/package_name/databases/database_name"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys ".tables"
WshShell.SendKeys "{ENTER}"
Set objShell = Nothing
// script ends
+0
đưa ra tất cả các nhận xét trước khi tạo tệp vb – Sush
Các vấn đề liên quan
- 1. Mở tệp cơ sở dữ liệu từ bên trong vỏ lệnh dòng lệnh SQLite
- 2. web.py cơ sở dữ liệu chọn truy cập
- 3. Cơ sở dữ liệu bị khóa khi cố gắng truy cập từ tập lệnh PHP
- 4. SQLite: cơ sở dữ liệu chỉ đọc
- 5. Tạo cơ sở dữ liệu nhúng Sqlite từ ứng dụng
- 6. Cập nhật các phiên bản cơ sở dữ liệu sqlite?
- 7. Tạo một cơ sở dữ liệu sqlite bằng cách sử dụng dòng lệnh shell trong windows
- 8. Cách sử dụng tập lệnh để truy vấn cơ sở dữ liệu sqlite android
- 9. Cách duyệt cơ sở dữ liệu SQLite trong bộ nhớ bằng công cụ dòng lệnh sqlite3
- 10. Lỗi khi tách cơ sở dữ liệu SQLite - cơ sở dữ liệu bị khóa
- 11. Hoạt động và dịch vụ nền Truy cập cơ sở dữ liệu SQLite
- 12. C# Cơ sở dữ liệu truy cập: DBNull vs null
- 13. Nhận tối thiểu từ cột cơ sở dữ liệu SQLite?
- 14. Truy cập cơ sở dữ liệu sqlite trên thiết bị Android
- 15. Cách truy cập cơ sở dữ liệu sqlite hiện có trong Android?
- 16. Chạy cơ sở dữ liệu cập nhật từ Team City
- 17. iPhone tạo cơ sở dữ liệu SQLite khi chạy?
- 18. Cách hiển thị dữ liệu trong datagridview từ cơ sở dữ liệu truy cập
- 19. Cập nhật mô hình từ cơ sở dữ liệu (Cơ sở dữ liệu đầu tiên)
- 20. Cơ sở dữ liệu Truy cập SQL trong Excel VBA
- 21. Chế độ xem Sqlite trên nhiều cơ sở dữ liệu
- 22. Cơ sở dữ liệu SQLite với FMDatabase Wrapper
- 23. Truy cập cơ sở dữ liệu dụng cụ
- 24. Cách tổ chức lớp Truy cập cơ sở dữ liệu?
- 25. Có tiện ích dòng lệnh nào để xác thực cơ sở dữ liệu SQLite trong Linux không?
- 26. tạo mã truy cập để nhập cơ sở dữ liệu
- 27. Tăng số lượt truy cập trong cơ sở dữ liệu
- 28. Truy cập Meteor cơ sở dữ liệu sản xuất
- 29. Truy vấn cơ sở dữ liệu thông điệp SQLite của Thunderbird từ C#
- 30. Cập nhật cơ sở dữ liệu Android
bạn đã nhận được gì sau khi nhập adb vỏ? – Yury
shell @ android:/$ – JustCurious
Đây có phải là thiết bị hoặc trình giả lập không? – Yury