Hello everyone.
I'm trying to take a screenshot of Ubuntu Touch (build r100) via ADB according to this manual on wiki.
Here's what i got:
Code:
[email protected]:~$ adb root
adbd is already running as root
[email protected]:~$ adb shell /system/bin/screencap -p /tmp/screenshot.png
And then it just hangs and create empty file. Any idea? Thanks!
Canonical switched from android display server to ubuntu mir and screencap will not work anymore.
Use this script for getting of screenshot: people.canonical.com/~j-lallement/touch/mirfbdump
PS. can't post link because of xda rules for newbies :-\
Related
Hi all!
I was using Modaco 2.9 before and it was amazing stable.
Later on I tryied [email protected] worked well, but not as stable as the modaco, so I thought lets change to the 3.0. Since that I have al lot system crashes, so I thought I need to do "deldalv and/or ext_wipe" with the RA-recovery-1.2.3
Figured out that it didnt work, it says I should use "adb deldalv"
I couldnt get the adb to run on my ubuntu linux, so I tried to find an update for the RA-recovery.
And there is RA-recovery-1.5.1 and I can just install it (cause I have a previous version) via adb.
Now My Question:
How does it work?!?
Code:
[email protected]:~$ adb usb
error: insufficient permissions for device
[email protected]:~$ adb devices
List of devices attached
???????????? no permissions
[email protected]:~$ adb kill-server
[email protected]:~$ adb start-server
* daemon not running. starting it now *
* daemon started successfully *
[email protected]:~$ adb usb
error: insufficient permissions for device
[email protected]:~$ adb devices
List of devices attached
???????????? no permissions
Code:
[email protected]:~$ cat /etc/udev/rules.d/50-android.rules
#Bus 001 Device 005: ID 0bb4:0c02
SUBSYSTEM=="usb", SYSFS(idVendor)=="0bb4",MODE="0666"
How do I connect the device then, if not like that?
How can I test if everything works?
Thanks in advance
Unicate said:
How do I connect the device then, if not like that?
How can I test if everything works?
Thanks in advance
Click to expand...
Click to collapse
afaik this looks good, try starting adb as root. this is what adb devices says for me:
Code:
[email protected]:~$ adb devices
List of devices attached
HT98XXXX427 device
Code:
./adb start-server
./adb shell
works for me (with root ofcourse )
I set up my system so that the adb deamon starts at boot.
Created a script in the /etc/init.d directory called adb:
Code:
#! /bin/sh
case "$1" in
start)
/home/joeblow/AndroidSDK/tools/adb start-server
;;
stop)
/home/joeblow/AndroidSDK/tools/adb kill-server
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
Created a link to it in /etc/rc2.d:
Code:
lrwxrwxrwx 1 root root 13 2010-01-09 19:17 S10adb -> ../init.d/adb
Off Topic...
Am sorry to be a little off topic.. I just got my Hero and was trying to figure out all the stuff about it here on XDA.. Can anybody tell me what is ADB ??.. Whats it used for ??.. As far as I have understood, I think its some sorta software to connect hero to the computer to transfer files and stuff.. Is it right ??.. If yes.. Then what is the difference between this and HTC SYNC ??.. Thanks in advance.. Cheers !!!
if You want only transfer files, You don't need ADB.
htc sync is for synchronizing phone (contacts, calendar, etc) with PC (i guess, i don't use it ) and for upgrading SW.
Has anyone successfully connected to their device via adb in Ubuntu?
Whenever I do
./adb devices
Click to expand...
Click to collapse
it shows me an empty list of devices.
I had originally set it up for my G1. Now that I try it with the Vibrant, it does not work.
I modified 51-android.rules file and entered this:
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
Click to expand...
Click to collapse
The code is bold was taken after I did the lsusb command.
I have connected with Ubuntu , which build of Ubuntu are you using? I am on Lucid (10.04) and it connected easily the first time.
srqt said:
I have connected with Ubuntu , which build of Ubuntu are you using? I am on Lucid (10.04) and it connected easily the first time.
Click to expand...
Click to collapse
I am also running 10.04
Can you please do me a favor and tell me what files the following folder has:
/etc/udev/rules.d
I'm interested in knowing if it has 50-android.rules and/or 51-android.rules and what are the contents of them.
Thanks!
dublued said:
I am also running 10.04
Can you please do me a favor and tell me what files the following folder has:
/etc/udev/rules.d
I'm interested in knowing if it has 50-android.rules and/or 51-android.rules and what are the contents of them.
Thanks!
Click to expand...
Click to collapse
It has 51-android.rules with the following contents
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Click to expand...
Click to collapse
Still showing up empty, thanks though.
This is what I used in Ubuntu 10.04 x86 and 9.04 x32
First download my zip file
Put the 3 rules files in your /etc/udev/rules.d folder (sudo nautilus /etc/udev/rules.d (This will open the folder with root access from the terminal))
Then right click on each file and go to properties
From there click on the permissions tab and make sure all files are checked to allow exe then change the owner from root to your username then close.
Then put the adb file in your android sdk/tools folder and replace the original one.
Then restart your computer
Once restarted make sure your phone is in debugging mode plug it into the usb and type sudo ./adb devices in the terminal and your phone should show up.
thanks the3dman13, that did the trick!
i'm curious thought, why did I need to replace the adb file?
It seems both adb's work. Not sure but the contents of the 3 rules files are the same which may mean you only need one of them.
this works for me - samsung vibrant
$ uname -a
desktop 2.6.35-22-generic #33-Ubuntu SMP UTC 2010 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu maverick (development branch) \n \l
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
$ sudo chmod a+rx /etc/udev/rules.d/51-android.rule
$ sudo restart udev
$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554 device
T959xxxxxxxx device
Never had to do any of this... all I have to do every once in a while is:
Make sure debugging is enabled on the phone
Plug in the phone via USB to the computer
Bring up a terminal in the tools folder
Run 'sudo ./adb kill-server'
Then run 'sudo ./adb start-server'
Run './adb devices' (add sudo if necessary but it isn't for me at this point)
still no luk
ive tried every method on this page
and none works
what am i doing wrong
or what must i do to debug/correct this problem?
I had the same issue with a fresh install of 10.04. I was finally able to get ADB to recognize the device by booting into the recovery menu. After it recognized it once, ADB continued to recognize the phone even when it was on.
testdev said:
$ uname -a
desktop 2.6.35-22-generic #33-Ubuntu SMP UTC 2010 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu maverick (development branch) \n \l
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
$ sudo chmod a+rx /etc/udev/rules.d/51-android.rule
$ sudo restart udev
$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554 device
T959xxxxxxxx device
Click to expand...
Click to collapse
This worked
Try this
puccaso said:
ive tried every method on this page
and none works
what am i doing wrong
or what must i do to debug/correct this problem?
Click to expand...
Click to collapse
You might try this: sudo tools/android update sdk --no-ui
As written in android-sdk-linux read me file:
Welcome to the Android SDK!
The Android SDK archive initially contains only the basic SDK tools. It does
not contain an Android platform or any third-party libraries. In fact, it
doesn't even have all the tools you need to develop an application.
In order to start developing applications, you must install the Platform-tools
and at least one version of the Android platform, using the SDK Manager.
Platform-tools contains build tools that are periodically updated to support new
features in the Android platform (which is why they are separate from basic
SDK tools), including adb, dexdump, and others.
To install Platform-tools, Android platforms and other add-ons, you must
have an Internet connection, so if you plan to use the SDK while
offline, please make sure to download the necessary components while online.
To start the SDK Manager, please execute the program "android".
From the command-line you can also directly trigger an update by
executing:
tools/android update sdk --no-ui
joshuapurcell said:
Never had to do any of this... all I have to do every once in a while is:
Make sure debugging is enabled on the phone
Plug in the phone via USB to the computer
Bring up a terminal in the tools folder
Run 'sudo ./adb kill-server'
Then run 'sudo ./adb start-server'
Run './adb devices' (add sudo if necessary but it isn't for me at this point)
Click to expand...
Click to collapse
adb:command not found,but "adb devices"works.
---------- Post added at 12:58 PM ---------- Previous post was at 12:48 PM ----------
testdev said:
$ uname -a
desktop 2.6.35-22-generic #33-Ubuntu SMP UTC 2010 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu maverick (development branch) \n \l
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
$ sudo chmod a+rx /etc/udev/rules.d/51-android.rule
$ sudo restart udev
$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554 device
T959xxxxxxxx device
Click to expand...
Click to collapse
it does't got 51 rules,how to add it in?
---------- Post added at 01:38 PM ---------- Previous post was at 12:58 PM ----------
the3dman said:
This is what I used in Ubuntu 10.04 x86 and 9.04 x32
First download my zip file
Put the 3 rules files in your /etc/udev/rules.d folder (sudo nautilus /etc/udev/rules.d (This will open the folder with root access from the terminal))
Then right click on each file and go to properties
From there click on the permissions tab and make sure all files are checked to allow exe then change the owner from root to your username then close.
Then put the adb file in your android sdk/tools folder and replace the original one.
Then restart your computer
Once restarted make sure your phone is in debugging mode plug it into the usb and type sudo ./adb devices in the terminal and your phone should show up.
Click to expand...
Click to collapse
testdev said:
$ uname -a
desktop 2.6.35-22-generic #33-Ubuntu SMP UTC 2010 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu maverick (development branch) \n \l
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
$ sudo chmod a+rx /etc/udev/rules.d/51-android.rule
$ sudo restart udev
$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554 device
T959xxxxxxxx device
Click to expand...
Click to collapse
what i got has only one thing that does't match your post despite the list,that is i don't got "SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"".the list is empty yet.does this infect to?
---------- Post added at 01:50 PM ---------- Previous post was at 01:38 PM ----------
the3dman said:
This is what I used in Ubuntu 10.04 x86 and 9.04 x32
First download my zip file
Put the 3 rules files in your /etc/udev/rules.d folder (sudo nautilus /etc/udev/rules.d (This will open the folder with root access from the terminal))
Then right click on each file and go to properties
From there click on the permissions tab and make sure all files are checked to allow exe then change the owner from root to your username then close.
Then put the adb file in your android sdk/tools folder and replace the original one.
Then restart your computer
Once restarted make sure your phone is in debugging mode plug it into the usb and type sudo ./adb devices in the terminal and your phone should show up.
Click to expand...
Click to collapse
I do it right what you post orderly,but the list is still empty.Could you help me alone?
I just did a major mistake by copying sh from Windows to /system/bin/sh. Not haivng the execute bit has stopped me from using adb shell.
Could someone provide a clockworkmod recovery file that restores sh & it's permissions? I would greatly appreciate it. Thanks!
Why not just run the fix permissions script from the advanced menu in clockworkmod?
Sent from my SCH-I500 using XDA App
well, would be easier from a linux box:
chmod 755 sh
adb push sh /system/bin/sh
adb reboot
i_am_enderst said:
well, would be easier from a linux box:
chmod 755 sh
adb push sh /system/bin/sh
adb reboot
Click to expand...
Click to collapse
Thanks. I fixed it through recovery mode shell via adb.
I'm getting the following garbage when I do ls within adb shell. Is there any way to fix this?
Code:
# ls
ls
←[1;34mcache←[0m ←[1;32minit.rc←[0m ←[1;34msbin←[0m
←[1;34mconfig←[0m ←[1;32minit.smdkc110.rc←[0m ←[1;34msdcard←[0m
←[1;34mdata←[0m ←[1;32minit.smdkc110.sh←[0m ←[1;34msqlite_stmt_journals←[0m
←[1;34mdbdata←[0m ←[1;34mlib←[0m ←[1;34msys←[0m
←[1;32mdefault.prop←[0m ←[1;32mlpm.rc←[0m ←[1;34msystem←[0m
←[1;34mdev←[0m ←[1;34mmnt←[0m ←[1;32msystem.prop←[0m
←[1;34mefs←[0m ←[1;34mpreinstall←[0m ←[1;34mtmp←[0m
←[1;36metc←[0m ←[1;34mproc←[0m ←[1;34muserdata←[0m
←[1;32mfota.rc←[0m ←[1;32mrecovery.rc←[0m
←[1;36minit←[0m ←[1;34mres←[0m
Those are bash color escape codes but I don't know why adb is outputting them since I'm new to Android.
It's a windows command prompt thing..
Easiest solution, do this from your adb shell (you'll need to do it each time)
export LS_COLORS=none
alternatively you can installed cygwin and spend a little time setting it up so that the ANSI colors are displayed when using adb shell.
I assume the colors show up fine under linux, which is why this got included in some kernels/rom packages without anyone addressing it.
Thanks for the info. It shows up correctly through a cygwin terminal. I'll just use that for now on.
I Request senior members to help me on this topic coz m a begainer to android m trying to root my cell since last 1 month but always i get an disappointment with 0 result so i request mods and senior members to help me in rooting my phone..
my cell is a made in china cell so i dont have the drivers
here are some more details for ur refference
campany name Aimax
model: R5830i
ANDROID VERSION: 2.3.5
BASEBAND VERSION: BASE_W12.17/sc6820_sp6820/04-20-2012/16:03:42
kernel version:2.6.35.7 [email protected]#9
software version:mocorDroid2.3.5.w12.09.10
hardware version:1.1.0
and one more thing when i connection to pc it shows found new hardware "spreadtrum phone" but it is unable to update the drivers...
Positive replies are always appreciated thanx in advance
Plez help
plez help waiting for your reply...
Rooting China phones in windows and linux
Try one of these:
1. Using linux {Recommended}Install Ubuntu or DebianEither
Install the android-sdk.
dl.google●com/android/adt/adt-bundle-linux-x86-20130717.zip <==x86
dl.google●com/android/adt/adt-bundle-linux-x86_64-20130717.zip <==x86_64
or
Just get the standalone adb and fastboot executables
texasice-cream-sandwich-mirror.googlecode●com/files/adb_fastboot.zipInstall ia32-libsRun this in a terminal
Code:
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
Now download the files required for root and put it in the same folder as adbmir●cr/GDEPZT4VAfter you finish installing the files,
Connect your device with debugging mode enabled
Run
Code:
cd path/to/adb
where "path/to/adb" is the directory of your adb file
Now run
Code:
sudo chmod a+x adb
sudo chmod a+x fastboot
>>Root
Code:
./adb devices
./adb push busybox /data/local/tmp/
./adb push su /data/local/tmp
./adb push Superuser.apk /data/local/tmp
./adb shell
Chmod and run the exploit under adb shell
Code:
cd /data/local/tmp
chmod 755 psneuter
./psneuter
Now re-engage an adb shell to check if the exploit worked.
Code:
./adb kill-server
./adb devices
./adb shell
If you see a # sign, the exploit was was successful. Otherwise repeat from >>Root
Now run these on the same adb shell
Code:
cd /data/local/tmp
./busybox ash
mount -o remount,rw /system
mv /data/local/tmp/su /system/xbin/su
chmod 6755 /system/xbin/su
chown 0.0 /system/xbin/su
mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk
chmod 777 /system/app/Superuser.apk
cp /data/local/tmp/busybox /system/xbin/busybox
chmod 6755 /system/xbin/busybox
Now reboot your device and open up SuperSU. Let it update the binary.
Your device should be rooted. 2. Use Windows + MoboroboMethod 1 {Recommended but hard}
Download Moborobo from
Code:
moborobo●com
This software can Install drivers for many china phones and other branded phones.
After installing Moborobo download the files required for root
Code:
mir●cr/GDEPZT4V
Extract the files to the installation directory of Moborobo.
Code:
C:\Program Files (x86)\Moborobo
Run a CMD window under that directory and type
Code:
xcopy AndroidInterface.exe abd.exe
Connect your device in debugging mode & Open up Moborobo, It will install the drivers.
Keep Moborobo open & Follow the instructions mentioned in >>Root
P.S- the linux commands begin with a "./" remove this in windows or else it won't work. Note: Wherever I mentioned a terminal, the windows equivalent to this would be cmdMethod 2 {Easier}
Download and Install Moborobo just like above and run this under a cmd on that folder
Code:
xcopy AndroidInterface.exe
Also download UnlockRoot or SuperOneClick
To make sure the adb files are same, Copy over
Code:
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
to UnlockRoot's tools directory or SOC's ADB directory
Connect your device in debugging mode and open up moborobo.
Now keep Moborobo open and Run UnlockRoot or SOC. Good Luck :good:
(c) Smo0thK, team BL4CKF1R3
Press thanks if I helped you.
Nice tutorial you have posted Smo0thK. Please also comment on the following points.
1) Which tablets have you tried the above methods to get root access. Since most of the tablets in Indian market are from China, same would be the situation in Bangladesh and similar techniques can be used. Please list their Brand and model numbers.
2) I personally use a Penta IS701c which actually is pre-rooted from factory but the su command does not work because configuration is messed up. (# prompt in ADB shell indicates root access) Many of these Chinese tablets come pre-rooted from factory but to get su command working things have to be cleaned up. What is your experience about this.
3) Android 3.1+ devices must support USB Host mode but most of the tablets are lacking support. (Use USB Host Diagnostics app to find out).
Have you found any tablet that supports USB Host mode without a custom kernel.
Best Regards,
Vineet Kumar
Hi All,
In my Java program I would like to capture screen of android device attached through adb. For that in command prompt I am able to execute
"adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > Screen.png"
How to do this in my program. I wrote code that create process and execute "adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g'". but I am unable to read input stream and write it to a .jpg file. File is corrupted and cannot open,
Thank you
iua said:
Hi All,
In my Java program I would like to capture screen of android device attached through adb. For that in command prompt I am able to execute
"adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > Screen.png"
How to do this in my program. I wrote code that create process and execute "adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g'". but I am unable to read input stream and write it to a .jpg file. File is corrupted and cannot open,
Thank you
Click to expand...
Click to collapse
Are you talking about Android Java or regular Java?
Have you tested using the command separately and tested what the output is?
BTW. Your perl line is wrong!, This is the good one
Code:
adb shell screencap -p | sed 's/\r$//' > screen.png
the one you tried is only for MAC OSX
broodplank1337 said:
Are you talking about Android Java or regular Java?
Have you tested using the command separately and tested what the output is?
BTW. Your perl line is wrong!, This is the good one
Code:
adb shell screencap -p | sed 's/\r$//' > screen.png
the one you tried is only for MAC OSX
Click to expand...
Click to collapse
Hi, I am talking about regular java. My java application is a desktop app run on PC. Yes I tested command in consol, it nicely captures screen of device attached via adb and save as a image files as per command given.
Now my requirement is to write a java program run on PC to capture screen, issue is I don't have idea how to do it with that way. If explain further I hope I could use "Runtime.exec" to pass "adb shell screencap -p | sed 's/\r$//' " but how can I create a image file on Workstation.