简体   繁体   中英

android- How to handle database not found in adb shell

Just i am creating the database in my app. Now i follow the following steps to see the database(for emulator case).

  1. run the app.

  2. C:[..path..]\\android-sdk-windows\\tools>adb devices

List of devices attached emulator-5554 device

3.C:[..path..]\\android-sdk-windows\\tools>adb -s emulator-5554 shell

Here i am getting database not found error.

4.#

ls /data/data/com.sqlitedemo/databases: not found

How to handle this.please can anybody help me.

package com.sqlitedemo;
import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

public class sqlitedemo extends Activity {

    SQLiteDatabase db;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        db = openOrCreateDatabase("TestData.db", SQLiteDatabase.CREATE_IF_NECESSARY, null);
    }
}

在ls和参数之间需要一个空格:

ls /data/data/com.sqlitedemo/databases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM