'How to change permission of internal folder/file in android?

I wanted to get database file from the emulator. So, I tried to change the permission of package folder using adb shell. When I use the below command:

adb shell su -c chmod 777 /data/data/com.mypackage.test

It always returns:

Chmod: need 2 arguments

I have changed permission some days ago using above command. But recently I'm always getting the above warning. I have searched a lot and found large information regarding using above command but no one mentioned about this warning issue.



Solution 1:[1]

I have overcome this issue instead of running adb shell su -c "chmod 777 /data", I run the adb shell first and then the following command : su -c "chmod 777 /data".

enter image description here

Solution 2:[2]

I have overcome this issue ? adb shell su -c 'chmod 777 /data/data/com.mypackage.test'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Patriotic
Solution 2