IntelliJ IDEA Android数据库同步未发生 [英] IntelliJ IDEA Android Database Sync Not Happening

查看:162
本文介绍了IntelliJ IDEA Android数据库同步未发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Intellij IDEA 13 Ultimate进行Android开发.如您所知,他们提供了一个不错的插件,该插件可以连接到已安装的Android应用程序数据库,并允许您修改其数据或架构,随后您可以单击同步按钮将所有这些更改发送到设备. (或者至少应该这样做)

出于某种原因,这对我而言没有发生.我已连接到设备并更改了一些数据,然后单击它,但它似乎执行了一些更新,即使我再次连接并同步时也得到了更新的数据,但UI中什么都没有发生?有什么想法吗?例如,我有一个显示在UI上的列表,使用此工具从数据库更改其标题后,即使我从任务管理器"中完全销毁了该应用程序并重新打开该应用程序,该列表也不会对UI反映任何内容.

更新1:

所以我尝试了上传"按钮,但这是我收到的错误:

数据源同步错误无法上传"Android SQLite": /system/bin/sh:无法创建 /data/data/com.something.someapp/databases/someappdb:权限 拒绝

所以我想这意味着它实际上没有用.

解决方案

我使它可以在模拟器中工作.这是我遵循的步骤:

  1. 将您的应用程序标记为android:debuggable="true".检查 此链接 ,以了解如何. (但这似乎不是必需的步骤,因为在调试环境中,ADT会自动为您执行此操作.)
  2. 看来,您应该使用已root用户的设备(如果您正在使用物理设备进行测试)或仿真器,默认情况下我应该已root用户.
  3. 问题图片中的
  4. 同步按钮以一种从远程数据库到本地数据库的方式检索数据.除非您单击右键单击要连接的数据库时出现的上载"按钮,否则所有更改都将保留在本地数据库中.
  5. 上传数据库后,您需要从最近活动中删除该应用程序.这是当您按住主页"按钮几秒钟时出现的列表.
  6. 一旦将其从近期活动"中删除,请继续并重新启动应用程序,您应该会看到数据库中的新更改反映到UI中.

注意:要使用此功能,您应该使用IntelliJ Ultimate Edition.

IntelliJ IDEA团队在

我将欢迎所有答案,但是如果我再次找到答案,我会在这里张贴它,不用担心!

I am using Intellij IDEA 13 Ultimate for Android Development. As you may know, they offered a nice plugin which connects to installed Android application database and allows you to modify its data or schema and later you can click on the sync button to send all these changes to the device. (or this is what it supposed to do at least)

For some reason this is not happening to me. I am connected to the device and changing some data and click on it but it seems it performs some updates, even I get the updated data when I connect and sync again but nothing happening in the UI? Any ideas why? For example, I have a list shown on the UI and after I change its title from database using this tool, it doesn't reflect anything to the UI even if I completely destroy the app from Task Manager and re-open it.

Update 1:

So I've tried Upload button but this is the error I received:

Data Source Synchronization Error Cannot upload 'Android SQLite': /system/bin/sh: cannot create /data/data/com.something.someapp/databases/someappdb: Permission denied

so I guess this means, it is not really working.

解决方案

I made it work within the emulator. Here are the steps I followed:

  1. Mark your application as android:debuggable="true". Check this link to see how. (But it seems this is not a necessary step since ADT does that for you automatically when you are in the debug environment.)
  2. It seems you should use either a rooted device (if you're using your physical device for testing) or an emulator which I guess rooted by default.
  3. Sync button in the picture in the question retrieves data in one way which is from remote database to local database. Any changes will remain in the local database unless you click on Upload button which appears when you right click on the database you're connected to.
  4. Once you uploaded your database, you need to remove the application from Recent Activities which is a list appearing when you hold on Home button for couple of seconds.
  5. Once you removed it from Recent Activities, go ahead and start your application again and you are supposed to see the new changes in your database reflected to your UI.

Note: In order to use this feature you should be using IntelliJ Ultimate Edition.

IntelliJ IDEA team talks about this Android SQLite Viewer in this link but they say it should work with unrooted devices doesn't sound right though.

My question is now how I am supposed to make it work with an unrooted device because when I try that I get the following error in IntelliJ IDEA:

Data Source Synchronization Error Cannot upload 'Android SQLite': /system/bin/sh: cannot create /data/data/com.something.someapp/databases/someappdb: Permission denied

I would welcome all the answers but in case I find the answer by myself again, I will post it here, no worries!

这篇关于IntelliJ IDEA Android数据库同步未发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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