I've been working with persistent state between launches of my Android application and wanted to easily inspect my application data between launches. I discovered the power of the Android Debug Bridge or adb tool. In short a dev tool that lets you hook up against a running Android simulator.
You'll find it in your sdk folder under platform-tools. On my machine:
C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe
A few handy commands:
- List currently running devices:
>adb devices
List of devices attached
emulator-5554 device
- Launch a terminal shell against a running device
>adb -s emulator-5554 shell
Then you can do your ordinary linux stuff like cd, ls, cat etcetera to get to know your Android device.
My happiest discovery was that the preference file you fetch and save via the SharedPreference API:
SharedPreferences settings = getSharedPreferences("OthelloLegendsPrefs", 0);
are located under the path
/data/data/se.noren.android.othello/shared_prefs/OthelloLegendsPrefs.xml
and is a simple XML file which you can inspect and edit.
So, to pull a file from the simulator to your development computer
>adb -s emulator-5554 pull <remotefile> <localfile>
Similarly, to upload a file to the device
>adb -s emulator-5554 push <localfile> <remotefile>
For more info on adb, http://developer.android.com/guide/developing/tools/adb.html.
Thank you! Debugging and I needed to know where that file was.
ReplyDeleteYour contents are too simple to read and easy to understand.
ReplyDelete-----------------------------------------------------------------------------
Android Application Developer India & Android Application Development Company
It is possible to install an app and perform other functions using the ADB android debug bridge on an emulator device, everything can be done while navigating through the tools of ADB. Using ADB to enter the android simulator is an advanced means to debug and administer one’s application. Further, I believe it is sufficient to say that more than enough can be done to assist in targeting increasing the success of your app. Moreover, concerning the creation of a well-structured funnel landing page it would definitely help in targeting users by providing help in navigating through the downloading and onboarding stages, thereby increasing the engagement rate and the conversion rate.
ReplyDelete