I have a rooted HTC device, and I want to access the /data/app/ directory on my phone to fix a bug, and I am looking for a way to do this from my PC rather than creating a new emulated environment just to fix that bug. It lead to a looping lock screen, where every three seconds I would end up at the lock screen.
If you have USB debugging enabled, you can try to open "adb shell" and inside of it get root permissions using "su" command. After that you can open any file in any folder through this shell window. Moving in between folders the same as in a Linux, and it's easy to Google how to do that.
Related
My phone ( android 5.0.2) have a pattern for password and broken screen,NO ROOTED.
I try this software (http://forum.xda-developers.com/showthread.php?t=2786395)for control my phone but I can't unlock my android device.
Can you give a solution for delete lock screen (I have tried this -> adb shell rm /data/system/gesture.key but I don't have permission)/others tools or others solutions?
You can remove any lock or pattern by deleting a file *.key located in /data/system.
You will need a shell and a rooted phone.
Otherwise, you could install a clockworkmod recovery that comes with an adb shell and use it to get full access to the file system.
Hope this helps.
if you aren't a root, you can not access the key file. So you can not change key or delete it. You must be root for deleting key file or changing the key file. Sorry.
You can only install a custom recovery if your bootloader is unlocked. On Nexus devices this wipes the device, I don't know about other devices. Many are not even capable of being unlocked.
So the solution to install a custom recovery to get write access to the system partition is not likely to work unless you've previously unlocked your bootloader.
I'm working on an app to enable people to upload photos from their phone, and I need to be able to test this functionality out in the AVD via emulator. However the AVDs don't seem to have any photos in storage so I can't use them for testing.
Is there an efficient way to get photos onto the virtual device and preferably keep them there so I can run multiple tests on them? I know I can debug on my phone as well (and have been doing that), however I would prefer to do most of my debugging on the emulator if possible.
I'm using the IntelliJ IDEA for development.
One way would be to open cmd window and type adb shell. You can then create a folder for the images you'd like in the sdcard folder. Then you can exit the shell and push the images to the device using adb push cmd.
It's pretty simple actually.
adb shell
cd sdcard
md directoryName
exit
adb push /sdcard/directoryName /pathToImage
I solved the issue by starting the Android Device Monitor in IntelliJ (Tools>Android>Android Device Monitor), navigating to the File Explorer tab, and copying pictures over to the sdcard>Downloads folder. In the device emulator, I selected 'show SD card' before I was able to use the pictures from that folder. It will probably be easier if I can find out how to put the pics on a device folder instead of SD card, but for now this suffices.
Thanks for the suggestion eclipse, helped me go down the right path.
I have a Nexus 4. I accidently wiped system and tried to restore it unsuccessfully.
I did have adb before I wiped the system. Now I can only get into recovery mode. When I use Nexus root toolkit it recognizes the device only in bootloader but it can't recognize it as adb device. I thought maybe now that Android is not installed USB, debugging is disabled as default.
Do I have a way to enable it or do you have any other solution? I can't use the device. Do I have any other way to install Android without adb?
adb isn't required (adb is only one of the ways to do it. As long as you still have access to recovery mode, you're golden).
Just get the zipped image you want to install (a modded one, or the official one). You should be able to get the official one from google since it's a Nexus 4. Do not unzip it.
Connect your phone to your computer as a usb drive. Copy the zip file to the root of your internal sdcard on your phone.
Reboot your phone into recovery mode. Then navigate the menu on the phone with the sound rocker and the power key to tell it where to find the new location of the new image.
Then reboot normally. I'm writing this from memory. If you want more specific instructions, I can provide them if you want.
Looking for the command (or steps) to create a shell script on android that tells the device to reboot into recovery mode and automatically restore a backup located in the /sdcard/clockworkmod/backup/ folder. I know the reboot is:
reboot recovery
But I imagine there is something else I either need to add to that line or perhaps create a file somewhere that instructs cwm to automatically restore a backup and reboot.
Found my own answer... For the folks in the ether...
Install ROM Manager Premium (small $$).
Use Koush's test rom manage project (https://github.com/koush/TestRomManager) to connect to ROM Manager and essentially ask it to reboot the device into recovery and do a backup. The system is actually incredibly powerful in that you can do some kool stuff over the air. This is a good setup for internally managed devices... You can even run your own update.zip scipts...
Optionally you can add a couple of exec lines to click ok automatically to the ROM Managers popup "do you want to reboot now?".
Thats it. Lots of research, as usual a Frankenstein of source from a great world full of devs.
If you follow the comments on this file, you will manage to do what you want
https://android.googlesource.com/platform/bootable/recovery/+/fadc5ac81d6400ebdd041f7d4ea64021596d6b7d/recovery.c
Specifically, you will have to deal with the file
/cache/recovery/command
And include there the command you want to issue. Root access is needed to do so.
Alternatively, if your recovery admits it (CWM, TWRP) you can just use the recovery command through adb once you rebooted there.
I recently bought a new phone (Motorola Electrify) and I'm trying to connect it with ADB but so far without luck. What I did:
Enable USB debugging on the phone
Connect phone to my iMac using the USB cable (the display indicates that it's connected)
Type "./adb devices" to list connected devices
Unfortunately nothing shows up. I even did a adb kill/start-server and I also added "0x22B8" to the adb_usb.ini (even though that shouldn't be necessary).
Can anyone point out what other steps I could take to debug why the device isn't showing up?
Thanks!
Thanks for your answers above, but I've resolved it myself. For anyone who has the same problem:
http://code.google.com/p/android/issues/detail?id=15583
has the answer.
It turns out that Motorola has several USB modes. I changed the mode to "USB Mass Storage" and it's working now. I did this by dragging the status bar down and clicking on "USB connection" to manage the USB connection.
In case anyone else isn't clear, usb debugging must be enabled (at least for a droid mini).
#Joris If you're loading multiple apps on your phone, you might be better off using the MTP mode on your phone (instead of USB Mass Storage) for reasons covered herein - http://www.androidcentral.com/ics-feature-mtp-what-it-why-use-it-and-how-set-it.
p.s: admittedly, this may not be backwards compatible, but hopefully everyone's finally upgrading to ICS and beyond
Step four found at this link may be helpful:
http://esausilva.com/2010/10/02/how-to-set-up-adb-android-debug-bridge-in-mac-osx/
Create an environment variable (Optional)
Open Terminal
Type cd ~ this will take you to your home directory
Type touch .profile this will create a hidden file named profile
Type open -e .profile this will open the file you just created in
TextEdit In the file, type export
PATH=${PATH}:/pathToTheAndroidSdkFolder/android-sdk-mac_86/platform-tools
Save file, close TextEdit, Quit Terminal, and Relaunch Terminal
NOTE: By creating an environment variable you won’t need to cd to the
Android/tools folder every time you want to run ADB