Opinions needed - windows adb wrapper in the works - G1 General

Thanks for taking a look at it. Hopefully soon I'll have much more going on in it.
v0.1a
adb cmd shell integration
ability to script adb commands
ability to save and edit scripts
local adb, no need to download the sdk
requires:
windows xp+
.net framework 3.5
instructions:
unzip
plug in phone
run adbwin.exe
that's it, not much more to it
any ideas, thoughts, constructive criticism would be great
again, thanks for taking a look
in the future I'd like to implement possibly a drag-drop interface for adb shell ls / push / pull, etc like a file manager

Us Linux guys never get any love.. hmm
Love the idea though, keep it up.

Excellent work, can't wait to see what else is in store for this... Posted a link on the AC forum...

i've been trying to do something like this for linux users, i am just afraid that if we release a nice little GUI for any of the operating systems in order to use adb we'll have more people with messed up phones. personally i prefer to work in the terminal, i set mine to green on black to remember the old days(before my time).

tubaking182 said:
i've been trying to do something like this for linux users, i am just afraid that if we release a nice little GUI for any of the operating systems in order to use adb we'll have more people with messed up phones. personally i prefer to work in the terminal, i set mine to green on black to remember the old days(before my time).
Click to expand...
Click to collapse
True I think terminal is just easy to use for everything.

tubaking182 said:
i've been trying to do something like this for linux users, i am just afraid that if we release a nice little GUI for any of the operating systems in order to use adb we'll have more people with messed up phones. personally i prefer to work in the terminal, i set mine to green on black to remember the old days(before my time).
Click to expand...
Click to collapse
yeah, but a properly built GUI would save a lot of time on daily chores like typing adb push path path. could have programmed a java version, but I am not sure if I would spend more time drawing the window or implementing the logic...

This is a great idea. I'd pay for a license.

Related

New to Android

Hello all so Im new to android I came over from BB I got sick of the worthless OS they keep updating. Im trying to get up to speed everything with android. I got root last night using the unevoked's new process. As Im reading different threads I keep hearing people refer to adb shell. What is this? I also have a PC and a MAC but I'm more of a Mac guy, is most the stuff you need to do better done on PC or can it be done on Mac's because they talk about opening a command line which of course is done in DOS. Can anyone shed light on this for me? Thanks in advance
adb is a part of the Google Android SDK. http://developer.android.com/sdk/index.html It's available for Mac, PC, or Linux. Really, it boils down to preference. I believe setup is easier for Linux and Macs, but it's still pretty easy for a PC.
You can use Terminal, or whatever. It just needs a command-line interface for you to type into.
Thank you for the link and the explanation. I think its been to long since Ive had a open source device im way behind the curve i guess. Is there a good thread or a site for someone like me to start at that will start at the beginning and explain what SDK is and everything else?
Firstly, for a general how to of what's going on with our device, adb, so on and so forth, this thread is pretty awesome:
http://forum.xda-developers.com/showthread.php?t=709220
For a more in depth explanation of development and the like hit up:
http://developer.android.com
For the vast majority of what you're going to be doing, you need to be pretty familiar with command line scripts and the like. Also, if you want to write applications, you'll need to know java. If you really aren't all that interested in developing and just want to know about adb, that first link is a pretty good crash course.

Replicate phone environment on PC?

Hey, I am entirely new to Android development. Is it possible to run Android OS inside a VM Player on my PC running Windows 7? I've done this with several flavors of Linux, but I dont know enough about how Android operates.
I'm not talking about just a development sandbox... a fully-functional installation of Android with networking capabilities would be the goal. Does anyone have experience with this?
First one with helpful answer gets a free iPad!!*
*some restrictions apply
----
EDIT: seriously, has nobody ever done this
Yes - see http://www.android-x86.org/
You can download a live cd version of Android compiled for x86 machines, and install it in your VM of choice. - Just pick Linux 2.6 as the host OS when creating your VM
(Though the Android emulator that comes with the SDK is pretty much fully functional, too, and more representative of an actual phone, since it's running Arm instructions rather than x86)
Cool, thanks for the tip
I havent played with the Emulator yet, or really gotten my hands dirty. Does the emulator just allow you to test your program, or does it emulate the entire OS- destop, applications, settings and all?
What I would really like to do (not sure if possible) is to do all the configuration for my phone OS via my PC, then just save the image and copy it to the phone. Starting to think this might not be easy
SilverStrings said:
I havent played with the Emulator yet, or really gotten my hands dirty. Does the emulator just allow you to test your program, or does it emulate the entire OS- destop, applications, settings and all?
Click to expand...
Click to collapse
The emulator in the SDK gives you pretty much a full phone environment (It's missing stuff like the google branded apps, but there are ways around that...)

[Q] Interacting with ADB programatically

Hello
I'm planning to write a program that will interact with an active Android phone (Leo specifically). I plan to do this using ADB (since it fulfills exactly what I need to do), but I'm not comfortable having to open a program shell every time, it's not really an efficient and fail-safe method of doing things.
I noticed that the ADB files in the SDK come with two dll files called adbWinApi and AdbWinUsbApi, but I couldn't import them to Visual Studio, so I'm guessing they can't be used as external resources (or they can and I'm just too ignorant). Anyway, I found no resources on how to use them, so I'm guessing adb.exe uses them, and unless someone can reverse engineer them for me and found the references I need to use, they're useless.
Does anyone have an idea how to interface with an Android device programatically? Using C# preferably, but any open 'handle' I can use would be helpful.
Thanks in advance.
This looks like it might be what you're after:
http://madb.codeplex.com/
This is a Managed port of the Android Debug Bridge to allow communication from .NET applications to Android devices. This wraps the same methods that the ddms uses to directly communicate with ADB. This gives more flexibility to the developer then launching an adb process and executing one of its build in commands.
Click to expand...
Click to collapse
Wow, looks interesting, I'll look into it.
Thanks for the great find!
Sent from my Android HTC HD2 using XDA App
Ambious said:
Anyway, I found no resources on how to use them, so I'm guessing adb.exe uses them, and unless someone can reverse engineer them for me and found the references I need to use, they're useless.
Click to expand...
Click to collapse
And why to reverse engineer a part of an open source project? Android is open, you know ;-)
http://android.git.kernel.org/?p=platform/system/core.git;a=tree;f=adb
Brut.all said:
And why to reverse engineer a part of an open source project? Android is open, you know ;-)
http://android.git.kernel.org/?p=platform/system/core.git;a=tree;f=adb
Click to expand...
Click to collapse
LOL, true. But is the SDK?
Sent from my Android HTC HD2 using XDA App
Ambious said:
LOL, true. But is the SDK?
Click to expand...
Click to collapse
I think so, I have linked ADB sources above. Maybe these sources are for adbd daemon on a phone only, but even if, then you have docs about adb protocol in OVERVIEW.TXT and SERVICES.txt files.
True, and I also noticed the ADB client emulates TCP anyway, so it shouldn't be too hard to replicate and 'hook in'. Thanks for the tip
Sent from my Android HTC HD2 using XDA App

What do you use to develop with?

I have been trying to learn how to do some android development for work and keep running into problems. I find it hard to believe that people are able to create a lot of these apps with the Google development tools in such poor condition.
I have set up a development system with eclipse and the android tools. One of the first problems I ran into is ADB crashing whenever I tried to debug and there was a device attached to the system. Didn't matter if I was trying to debug on the device or emulator, ADB would crash. I was finally able to get the problem fixed by using the Composite ADB interface driver instead of the plain ADB interface (would it really hurt Google to add one sentence to the directions to tell people this?)
Now every time I go to debug, the emulator comes up in Chinese/Japaneses. I type in English and it converts it. I can fix it by changing the input method, but I have to do it every time I start the emulator. I have Googled looking for a solution and have found this is a known problem that has been around for almost a year and there is no resolution with it. The bug reports I have found on the android site even lists them still as NEW!
When trying to debug a problem, I wanted to delete the shared preference file for the app as it seems like it had become corrupted and every time it went to read it, the app would force close. (And when this happen, the debugger perspective would come up but for the life of me, I could not find any information as to what caused the fault or any sort of stack trace to look back and see where in my code it failed).
If you are an app developer, are you running into these issues? Have you found ways to work around the problems? I just can't believe that this is the way people develop for this platform. I'm ready to tell my boss that we forget about the platform unless we can find some stable development tools, otherwise we will be spending more time fighting with the tools than working on the app.
If anyone has any suggestions, I would really like to hear them. I'm not a noob when it comes to software development (20+ years as a software engineer), but I have never seen development tools for such a major platform, be this poorly done. What am I missing?
I'm a professional developer as well too. 20 years or so as a C/C++ developer, but I've worked most of my career as a Unix developer. Naturally, I use linux where possible and my Eclipse setup on Gentoo linux is pretty stable. I tried on Win7-64 but it was buggy as heck. I believe that the problem is with Java. There seems to be so many ways to set it up wrong that I'm not sure you can set it up right under windows.
I find it ironic that Oracle is trying to sue Google for making a JVM that actually works!
I havent had any of your mentioned issues. I am running eclipse on a 32 vista machine and a 64 bit windows 7 machine.
Not sure what I may have done different that you for setup. But I followed the Android application development for dummies book. The author goes step by step of what to download and how to install and configure. Even though your software experience is way beyond this book maybe its worth picking it up to read the install notes.
FreeTheWorld said:
I havent had any of your mentioned issues. I am running eclipse on a 32 vista machine and a 64 bit windows 7 machine.
Not sure what I may have done different that you for setup. But I followed the Android application development for dummies book. The author goes step by step of what to download and how to install and configure. Even though your software experience is way beyond this book maybe its worth picking it up to read the install notes.
Click to expand...
Click to collapse
I picked up the book, "Sams Teach Yourself Android Application Development in 24 Hours" and it has a section for setting up the environment too. Followed it to the letter several times and always had this problems. I think the issue comes down to the books were written using version 6 and 7 of the SDK and the current version, 8, has introduced some problems the books don't cover. For example, the tools directory has been split into two directories, tools and platform-tools. When you first download the SDK, you don't get everything you had like before until you update the SDK.
I have talked to several other people who also had the problem with the ADB crashing like I did, even started a thread here about it. No one could get any help anywhere on resolving the issue. I think the problems I have that others don't see is because they started with an earlier version of the SDK.
Gene Poole said:
I'm a professional developer as well too. 20 years or so as a C/C++ developer, but I've worked most of my career as a Unix developer. Naturally, I use linux where possible and my Eclipse setup on Gentoo linux is pretty stable. I tried on Win7-64 but it was buggy as heck. I believe that the problem is with Java. There seems to be so many ways to set it up wrong that I'm not sure you can set it up right under windows.
I find it ironic that Oracle is trying to sue Google for making a JVM that actually works!
Click to expand...
Click to collapse
I have also setup the development platform on a linux system and haven't had the problems I have with Windows 7 64bit. I also feel a lot of the problems have come from the Windows 64bit platform and even windows in general. I tried installing on a clean 64bit and 32bit Windows 7 and was still having the ADB problem. As soon as I get my tax refunds, I'm going to get a work desk setup at home so I can try using my linux system (it sits on the floor with no monitor and is my network server). Boss will really love it if I tell him we have to set up linux platforms to develop on. Guy is a bit of a tight wad when it comes to equipment.
edboston said:
If you are an app developer, are you running into these issues?
Click to expand...
Click to collapse
Nope, I didn't have any stability problems with SDK. I use linux 32-bit, didn't try to work on a Windows, MacOS and/or 64-bit arch.
I've not seen any of your problems, either.
FYI, I followed these instructions to set up the env:
http://developer.android.com/resources/tutorials/hello-world.html
(Environment - WinXP/32 netbook)
Eclipse is buggy. The most annoying issue with it is that the auto complete freezes your computer at times.
An alternative is IntelliJ. They offer a free community addition. I work with one dev that swears by it.
I use Windows7x64 and Ubuntu 10.10 to develop my apps. I use IntelliJ mostly because I find Eclipse to be convoluted overcomplicated mess. I think the Android integration in Eclipse is better, especially around editing some of the key XML files but I despise how projects are organized in Eclipse.
The OS you use really doesn't matter the results are the same, once you're up and running the work will be the same so the OS becomes irrelevant. The IDE becomes the differentiator.
I haven't met with the issues you mentioned, but as you said it can be because I installed the sdk a long time ago (after google anounced the eclair). I'm using eclipse and yes, that program is full of bugs, but I read an article about developing for android in Netbeans (my personal favorite). You can read it here: http://androidportal.hu/2011-01-09/fejlesztes-androidra-netbeans-segitsegevel (it's hungarian, but google translate is our friend)
Sent from my GT-I5700 using XDA App
MotoDev Studio 2.01
stick to 32-bit Galileo
for the slow autocomplete problem, I've made sure to use eclipse Galileo, something in Helios was causing massive lag. Also make sure you're running the 32-bit version of eclipse, even if your machine is 64-bit, there are definitely some bugs last time I tried to install ADT on 64-bit eclipse.
the new tools directory was a bit of a pain after updating to the latest API but nothing too bad once you figured it out.
I haven't had many of the other problems you mentioned. I always debug with adb logcat from terminal, and you can always hop into the device with adb shell.
I use eclipse every day at work so I've kind of gotten used to all the little quirks. I had the chinese text problem with the emulator, but I do most of my testing on a real phone. I use the emulator just to try out different resolutions.

Arm Linux OS's with Linux Deploy

If you don't understand what ssh or vnc is, please don't attempt this.
I am able to run Kali Linux armhf on the 13.3.1 by following this guide. It can run other distros too.
I can confirm it is working 100% and runs very smooth. Here is a link to the Linux Deploy app. You need a vnc app or a ssh app to interface with it. I recommend Real VNC Viewer. Instead of connecting to your private ip, just connect using your loopback 127.0.0.1 It is faster.
I hope this could be of some use towards cracking the bootloader. Comments, questions, discussion wanted.
Nice idea but what can you really do on Kali that you can't do via adb shell?
PS putty ftw!
Sent from my Nexus 4 using Tapatalk
Spec-Chum said:
Nice idea but what can you really do on Kali that you can't do via adb shell?
PS putty ftw!
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
Install linux native applications, light server, supports many linux distros like gentoo arch debian ubuntu fedora. Aircrack-ng, reaver, sslstrip, metasploit. The fun stuff.
Faznx92 said:
Install linux native applications, light server, supports many linux distros like gentoo arch debian ubuntu fedora. Aircrack-ng, reaver, sslstrip, metasploit. The fun stuff.
Click to expand...
Click to collapse
Nice, I'm sold
Repurpose a device
I would really like to get a different OS on my device or even do a GRUB bootloader kind of thing which will allow Android or another OS. I want to repurpose a tablet for my car project and I don't want to use Android.
I have done the VNC thing in the past with Ubuntu and it was horribly slow. Anything emulating on top of an OS will be less than optimal. I have used VMPlayer and VirtualBox before on a regular desktop and they seem ok. But still I'd like another OS that will be fast on boot up and ready to go in the shortest amount of time.
chris
This is very interesting. Has anyone managed to get Mer working through Linux Deploy? Having Plasma Active running like that would be pretty awesome. Other DEs aren't really optimised for touch the way Plasma Active is.
EDIT: Actually, it might be possible to get Plasma Active running via Gentoo, as they have an overlay for it. Still experimental, but then what isn't experimental at this point
GreatEmerald said:
This is very interesting. Has anyone managed to get Mer working through Linux Deploy? Having Plasma Active running like that would be pretty awesome. Other DEs aren't really optimised for touch the way Plasma Active is.
EDIT: Actually, it might be possible to get Plasma Active running via Gentoo, as they have an overlay for it. Still experimental, but then what isn't experimental at this point
Click to expand...
Click to collapse
You use a vnc app on loobback address(127.0.0.1) to connect. It is the fastest emulation I ever had running on any device. This is perfect for me if i can get a keyboard working. If you lower the resolution of the linux guest with a ui like lxde it is very easy to use it as a touch interface.
Mr_Ada said:
I would really like to get a different OS on my device or even do a GRUB bootloader kind of thing which will allow Android or another OS. I want to repurpose a tablet for my car project and I don't want to use Android.
I have done the VNC thing in the past with Ubuntu and it was horribly slow. Anything emulating on top of an OS will be less than optimal. I have used VMPlayer and VirtualBox before on a regular desktop and they seem ok. But still I'd like another OS that will be fast on boot up and ready to go in the shortest amount of time.
chris
Click to expand...
Click to collapse
Try it out on the loopback address 127.0.0.1 It is blazing fast with ui like lxde or xfce. Fastest I ever seen on a tablet/android.
Faznx92 said:
You use a vnc app on loobback address(127.0.0.1) to connect. It is the fastest emulation I ever had running on any device. This is perfect for me if i can get a keyboard working. If you lower the resolution of the linux guest with a ui like lxde it is very easy to use it as a touch interface.
Click to expand...
Click to collapse
Yea, thanks. I'll read a bit more on Linux Deploy to see how it works. And I'm very familiar with Gentoo (have three Gentoo devices here), so setting it up shouldn't be a problem. I also asked on their IRC, and they said Plasma Active should theoretically compile on Gentoo ARM, but nobody ever tested it. Sounds like a good opportunity to do just that!
Got to run Gentoo, although it required a bit of effort. Since I want Plasma Active, I didn't choose any GUI (I need to set it up manually). However, the problem is that SSH wouldn't run, either, citing that OpenRC wasn't started itself, and that I had to execute touch /run/openrc/softlevel in order to get it to start. Which is nice and all, but it's a circular dependency: to create the file, I need to log in through ssh, and to log in through ssh I need to create the file. So I ended up doing this:
Create a bash script file with that line
Upload it to the device (I put it in the downloads directory)
Do a "chmod 777 /datamedia/media/0/Download/<myscriptfilename>.sh"
In Linux Deploy:
Enable Custom mount (leave the path default)
Enable Custom startup
Set Script file to "/mnt/0/Download/<myscriptfilename>.sh"
That allowed me to create that file and start sshd correctly. So now I can log in via ssh, yay!
It makes me wonder, though – is there a support forum for Linux Deploy in English? Their main forum seems to be Russian...
GreatEmerald said:
Got to run Gentoo, although it required a bit of effort. Since I want Plasma Active, I didn't choose any GUI (I need to set it up manually). However, the problem is that SSH wouldn't run, either, citing that OpenRC wasn't started itself, and that I had to execute touch /run/openrc/softlevel in order to get it to start. Which is nice and all, but it's a circular dependency: to create the file, I need to log in through ssh, and to log in through ssh I need to create the file. So I ended up doing this:
Create a bash script file with that line
Upload it to the device (I put it in the downloads directory)
Do a "chmod 777 /datamedia/media/0/Download/<myscriptfilename>.sh"
In Linux Deploy:
Enable Custom mount (leave the path default)
Enable Custom startup
Set Script file to "/mnt/0/Download/<myscriptfilename>.sh"
That allowed me to create that file and start sshd correctly. So now I can log in via ssh, yay!
It makes me wonder, though – is there a support forum for Linux Deploy in English? Their main forum seems to be Russian...
Click to expand...
Click to collapse
Great job! It looks like the original dev was russian and their github is in russian but use google translate. Hope this helps.
Android Terminal Emulator
Faznx92 said:
Great job! It looks like the original dev was russian and their github is in russian but use google translate. Hope this helps.
Click to expand...
Click to collapse
I actually took concepts from Linux Deploy and Complete(??) Linux Installer, and built a set of scripts to do all the chroot work without needing an Android app. Since I primarily use the terminal, running everything from the shell is much easier than using an app.
Using something like Android Terminal Emulator, you do not need ssh on the android side at all. You simply su to root and run a chroot command:
chroot <linux-mnt-pt> /bin/bash -i
or
chroot <linux-mnt-pt> /bin/su <user>
or
chroot <linux-mnt-pt> /bin/login <user>
The last option requires typing a password, but since it's a login, it sets up your environment correctly. The other two inherit your Android PATH (among other things), so you have to set PATH by hand or use an rc file which sets it from scratch.
Personally, I find even LXDE much too slow for regular use over vnc. Most of my interest revolves around emacs and gcc, which both work great in Android Terminal Emulator.
-Pie
Faznx92 said:
Great job! It looks like the original dev was russian and their github is in russian but use google translate. Hope this helps.
Click to expand...
Click to collapse
Ah, thanks for pointing that out. His issue list is in English, and that's exactly what I need!
I talked to people over at #systemd to see if it would be possible to have systemd launching things in a chroot, and unfortunately it seems to be impossible for the Kindle Fire HDX 7, because its kernel is not compiled with PID namespaces that systemd requires to function, and we don't have any means to compile custom kernels as far as I know. It's too bad, but I guess I can cope with OpenRC for now.
EatingPie said:
I actually took concepts from Linux Deploy and Complete(??) Linux Installer, and built a set of scripts to do all the chroot work without needing an Android app. Since I primarily use the terminal, running everything from the shell is much easier than using an app.
Using something like Android Terminal Emulator, you do not need ssh on the android side at all. You simply su to root and run a chroot command:
Click to expand...
Click to collapse
Interesting, although I do prefer an app (it's really quite convenient). Also, as far as ssh goes, I do prefer having that running over typing things into the terminal using the touchscreen.
Overall the experience of running Gentoo on ARM is interesting. The Snapdragon 800 is really quite a beast, but rather peculiar. There are often delays before my input starts to be processed, but once it does, it runs very fast, until it goes idle again. And the speed at which it compiles things is amazing. It's also nice that I can use all of those nice optimisations (I'm using -march=native and -mfpu=neon-vfpv4, with the neon USE flag enabled; I'd like to set -mcpu to something specific, but it doesn't seem to have Snapdragon as an option).
Ubuntu os
Maybe sometime we would be able to get Ubuntu os on our tabs.
zhable said:
Maybe sometime we would be able to get Ubuntu os on our tabs.
Click to expand...
Click to collapse
You already can, although it's limited to the desktop version (which isn't any good when it comes to touchscreens). Not sure if Ubuntu Touch will be available at some point. But eventually Ubuntu will ship Unity 8, which will be more touch-friendly.
This is all great news!
GreatEmerald said:
Overall the experience of running Gentoo on ARM is interesting. The Snapdragon 800 is really quite a beast, but rather peculiar. There are often delays before my input starts to be processed, but once it does, it runs very fast, until it goes idle again. And the speed at which it compiles things is amazing. It's also nice that I can use all of those nice optimisations (I'm using -march=native and -mfpu=neon-vfpv4, with the neon USE flag enabled; I'd like to set -mcpu to something specific, but it doesn't seem to have Snapdragon as an option).
Click to expand...
Click to collapse
I don't think -march=native is doing anything there buddy.
GCC doesn't officially "support" Krait (yet), nearest I can see would be Cortex-A9 which uses the same scheduling model (albeit with 3 less pipeline stages) as a Krait. Interestingly, LLVM/Clang has just patched in a krait -mcpu target, if you can use that. To be honest you'll not be gaining too much as, IIRC, the main difference between a Krait and an A9, in compiler specific terms, is vfp4, but you're setting that with the -mfpu option anyway.
My point after spouting that gibberish is to not sweat it, lose -march, change -mcpu to cortex-a9 and you're golden. At least until a krait mcpu target for GCC...
Spec-Chum said:
I don't think -march=native is doing anything there buddy.
GCC doesn't officially "support" Krait (yet), nearest I can see would be Cortex-A9 which uses the same scheduling model (albeit with 3 less pipeline stages) as a Krait. Interestingly, LLVM/Clang has just patched in a krait -mcpu target, if you can use that. To be honest you'll not be gaining too much as, IIRC, the main difference between a Krait and an A9, in compiler specific terms, is vfp4, but you're setting that with the -mfpu option anyway.
My point after spouting that gibberish is to not sweat it, lose -march, change -mcpu to cortex-a9 and you're golden. At least until a krait mcpu target for GCC...
Click to expand...
Click to collapse
Nope, -march=native sets -march to armv7-a, which is close enough. The point in using it is that as soon as GCC gets better optimisations, -march=native will use the more optimised choice, without manual intervention.
too slow download
very slow retrieving of files from server i have a 2 mb/s line
any idea how should i retrive it offline
---------- Post added at 06:24 PM ---------- Previous post was at 06:00 PM ----------
suit urself and paste any one link in mirror url in linux depoly settings for kali and other deployments
http://http.kali.org/README.mirrorlist
remove the readme when adding the url ... press thanks nd make me feel aprreciated

Categories

Resources