Use ADB to backup and restore local data for testing 2

Android •

Three years ago, I wrote a note about how to use adb to backup the test data. At that time, or at the time when I created the scripts (before writing the note), we were still able to save files in the common spaces such as SDCard by using ...

Leetcode 148: Sort list - with Radix sort

Leetcode •

The question is simple: Given the head of a linked list, return the list after sorting it in ascending order ...

LeetCode 321: Create maximum number — a dynamic programming approach

Leetcode •

You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digits of two numbers. You are also given an integer k ...

A very simple argument parser

Scripting •

I’m a guy who usually writes a lot of script files to automate my daily routine. To extend the flexibility of the script, a good piece of advice is to make the script accepts parameters passing from command ...

Use ADB to backup and restore local data for testing

Android •

In addition to making ADB more useful in testing and debugging Android apps, today I would like to introduce a short trick to backup and restore the local data for testing. Test data on debugging built app is as important as the real data on users’ devices. Have you ever had to clean the app data to be able to start the app for debugging? Or have you ever worked in parallel for debug and release versions and they have different versions of Database? If the answer is YES (I’m sure most of us do), it hurts, especially when the data is related to date or time (UI is different for items created last month and today); or it’s hard and takes time to create test data (like creating new accounts) ...