[App] Tiny apk installer (adb required) - Android Software Development

A small app I wrote for my convenience. The source code is about 13 lines long, it has no advanced features, simply an easier way of typing in "adb install path/to/file".
Currently windows only, if it gains a few downloads i'll release a linux app.
If anyone wants the source feel free. It was coded in C++
Simply drag the apk file onto the exe. or set it as the default program for opening the file, then all you have to do is double click on the apk for it to install.
It won't tell you if there are any errors (though you may see it in the command window that pops up momenterilly). This was a personal project for my own convenience I just thought I'd post it here.

Nice, I created similar thing:
a little batch-script for windows
Code:
@echo off
echo Installing %1
echo ---------------------------------------------------
"C:\android-sdk-windows\tools\adb.exe" install %1
echo ---------------------------------------------------
pause
@echo on
I saved it in my windows folder and assigned the *.apk filetype to it in Folder Settings->File types with this:
apkinstaller.bat %1
After that: double click on your apk and voila

Related

[tip] install, sign apk, ..etc on right click (windows)

I've been hesitating on posting this for a while now (as its quite simple) but It may save you a ton of time like it continues to save for me.
1) write a batch file to do what you want, %1 is the file name+path argument passed to it
2) associate .apk files with the batch file. right click on apk-> open with-> choose program ->select the batch file
Many possibilities:
sign, install, decompile etc
here is the code for install.bat which I keep at x:\android-sdk\tools (same folder as adb)
Code:
adb install -r %1
pause
For sign: (creates a new .apk with -signed appended at the same location)
Code:
cd "x:\path\to\signapk.jar\"
java -jar signapk.jar testkey.x509.pem testkey.pk8 %1 %1-signed.apk
pause
For decompile: (decodes to a new folder with the same name+"-decoded" as the .apk
Code:
cd x:\path\to\apktool.jar\
java -jar apktool.jar d %1 %1-decoded
pause
thats pretty neat, nice tip
I'm dumb. I didn't read the first part of what you typed, figured the rest didn't work, searched google to come up with my own routine, figured out yours is extremely easy once you actually read it haha.
Oh well, at least I learned a little more DOS.
APK install bat with a prompt:
Code:
@echo off
set /p userinp=Do you want to install %1 y/n:
if "%userinp%"=="y" goto ADBINSTALL
exit
:ADBINSTALL
adb install -r %1
pause
EDIT: Forgot to say thanks.
yeah simple dos batch files can automated lot of monotonous tasks, I use them a lot for work

[Linux] Copy files to your phone via an adb GUI.

I just thought I'd throw this script up here in case any Linux users want something to play with. I use it for copying nightly ROMs to my phone for flashing. It simply gives a file selection dialog, allows the user to select files, and copies them via adb to a specified directory on the phone.
There's really not much to it, but it can be edited to point to any directory (I use /sdcard/Android-updates on my phone because it shows up at the top when I want to flash.)
Prerequisites:
Linux distro with gtk/gnome installed.
Zenity installed.
Working adb with normal-user privileges.
Just re-name the file, changing the extension to ".sh" and in the right-click "properties" dialog, change the permissions to make it executable.

Guide to setting up ADB for Ubuntu/Linux

Hopefully his isn't totally redundant or horribly written, MODS feel free to do what you will with it. This is just me trying to give back to the community that's giving so much to us.
This is for the ubuntu/linux user that has never setup or succesfully set up the android sdk and adb but does know what terminal is and is fairly computer literate.
AKA: I couldn't Find the guide I'd been looking for so I decided to write it myself.
Credit goes to s3gfault for getting me thru this process and having the knowledge, this guide is based off the steps that he guided me thru and I recorded over a chat log. This guide is written for someone who has no idea where to start or what to do or has tried and failed to get adw/sdk fully functional on their linux/ubuntu box.
Step 1) Create a folder named "ANDROID" in your home folder
Step 2) Download the Android SDK for Linux(i383) from here: Android dev site and place it in the newly created ANDROID folder
Step 3) Right click on "android-sdk_r10-linux_x86.tgz" (the file you just downloaded and moved to the ANDROID folder) and select "Extract here"
Step 4) Open the Ubuntu Software Center. Select Edit-->Software Sources (at this point it will ask for your sudo/root password)-->Other Software. Checkmark "Canonical Partners" then Close
Step 5) Right next to the "Get Software" in the left hand list column in the Software center you will see a arrow/indicator. Ckick on that to expand the list and then select "Canonical Partners" Look thru the list on the right and find "Sun Java(TM) Development Kit(JDK) 6" and click "more info." In the "Add-Ons" section* checkmark the (sun-java6-javadb) package and (sun-java6-source) options. Click "Apply Changes," and accept the License Agreement. Exit the Software Center after install.
*honestly the extra add-on packages may not be needed (I honestly don't know) but unless you're hurting for bandwidth I can't see them hurting.
Step 6) Start a terminal session and input
Code:
sudo vi /etc/udev/rules.d/70-android.rules
Terminal will then ask for your password, then will output something that should look like this:
Code:
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/udev/rules.d/70-android.rules" [New File]
once it does, close the terminal window.
Step 7) Start a new terminal window and input
Code:
gksudo gedit /etc/udev/rules.d/70-android.rules
This will open the geditor. Once it does paste
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
INTO the GEDIT file, Save and Exit. Exit terminal.
Step 8) Navigate back to your "ANDROID" folder. open the file folder that you exctracted, multi-select the contents of the entire folder (folders add-ons, platforms, tools and a readme.txt) and cut/paste them directly into the ANDROID folder where the .tgz file is. Delete the now empty shell folder. Navigate to ANDROID/Tools/ find the file named "android" and double click on it. A pop-up box will appaer asking you what you want to do. Click "Run". At this point the Android SDK and AVD Manager will open. in the left navigation pane select available packages. IMPORTANT: If you're in a hurry or low on bandwidth you can expand Android repository--> and just select "Android SDK Platform-tools, revision 3" as that is where ADW is located, otherwise you may want to go ahead and install everything. Your choice.
Click "Install Selected"-->"Install" after download pop-up about ADW, select "Yes" watch the dialogue for a succesful kill/restart of ADW and then hit "Close" and exit the SDK Manager
Step 9) Open a terminal session and type
Code:
cd /home/*****/ANDROID/platform-tools
where ***** is your ubuntu username, in the case of my laptop, loganmobile.
Protip: navigate to the adb file and right click-->Properties copy/paste path after cd command in terminal.
Step 10) On your Android phone: Menu-->Settings-->Applications-->Development: USB Debugging. Make sure it is checked on. Connect your phone via usb to your computer, DO NOT mount as sdcard.
Step 11) Back in terminal type in
Code:
./adb devices
it should now list your phone! huzzah!
Step 12) And you thought you were done? A few more things to wrap everything up all nice and tidy.
Open a new terminal instance and type
Code:
gedit ~/.bashrc
and add this line to the bottom of the file:
Code:
export PATH=$PATH:/home/*****/ANDROID/platform-tools
where once again ***** is your Ubuntu username. Save and exit the file.
Reboot your machine and verify that ADB still works afterwards via the same
Code:
cd /home/*****/ANDROID/platform-tools
./abd devices
winning
***DISCLAIMER***
I am by no means an expert and s3gfault is not at fault if you blow something up, he coached me thru this and it worked for me on both my desktop and laptop running Ubuntu 10.10. I provided this write up in hopes that it helps someone who was/is in the same boat I was in; somewhat lost and very frustrated as to why their adb didn't work right. Please add critiques and suggestions, or just flame me.
Thanks go out to andrew8806 for helping root my thunderbolt the first go around, jcase for helping me reroot it after it somehow messed up (and being an awesome dev) and s3gfault for handholding me thru the process of getting adb permanently working.
Good write up
Sent from my Thunderbolt using XDA Premium App
Guess this isn't as useful/helpful as I thought it would be.
qwirked said:
Guess this isn't as useful/helpful as I thought it would be.
Click to expand...
Click to collapse
It is if your new to linux, it's really a good write up
Sent from my Thunderbolt using XDA Premium App
Another, bit more compehensive guide, good one:
Lazyman's installation guide to ADB on Ubuntu 10.10
Cheers!
I found it helpful
qwirked said:
Guess this isn't as useful/helpful as I thought it would be.
Click to expand...
Click to collapse
I liked it and found it quite helpful. I've known how to use adb in windows, but not Ubuntu (which I use 90% of the time) until now. This write up got me going and I would like to say thanks...
Now I don't have to boot into windows for adb anymore
Thanks mate i know this is a very old post but believe me you have helped me much thank you...
or you can follow my signature.

[GUIDE/Linux] Install Android SDK the "Linux way"

Hi everyone.
I will show you how to install Android SDK. After this installation, you will have CLEAN, FULLY WORKING Android SDK environment useful for PROGRAMMING, using ADB utility and for OTHER THINGS. Note that this installation will work for ALL users on one computer, so its SYSTEM-WIDE installation (best solution).
This GUIDE WILL WORK WITH ALL LINUX DISTROS (tested on Arch/Debian, 32bit PC).
------------------------------------------------
WHAT WILL YOU NEED?
- Android SDK installation files (download file for LINUX, android-sdk_rXX-linux_x86.tgz - remember to replace "XX" with actual version number you have downloaded)
- Linux machine
- internet connection
- text editor (gedit, Kate, nano or any other)
- tar (is preinstalled on all Linux distros)
------------------------------------------------
LET'S GO
Download Android SDK for Linux and store that android-sdk_rXX-linux_x86.tgz file in your home directory.
Launch terminal and navigate to your home folder with this command:
Code:
cd ~
Extract downloaded android-sdk_rXX-linux_x86.tgz file with this command:
Code:
tar xvzf android-sdk_rXX-linux_x86.tgz
After extraction, you have "android-sdk-linux_x86" folder in your home directory. Now we will copy this folder into /opt folder (i chose this folder, because its used even for JDK and its system wide directory). Copy extracted folder with this command:
Code:
sudo mv android-sdk-linux_x86 /opt/android-sdk
After this, Android SDK is copied into /opt directory.
Now we have to register our Android SDK paths with our Linux system. Path to our Android SDK is now /opt/android-sdk/. We can find folders add-ons, platforms and tools (for example) in this path. To complete Android SDK installation, open your ~/.bashrc file with your favourite text editor. If you use gedit, then use this command:
Code:
gedit ~/.bashrc
Text editor with text file opens now....
After its opened, scroll DOWN to the end of file and put on the LAST LINE of that file:
Code:
export PATH=${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
Then save file and exit text editor. This step added our Android SDK paths to Linux SYSTEM-WIDE path, so that we can use for example adb by simply typing "adb shell".
Basic installation is now complete. To make SDK usable, type this to terminal:
Code:
sudo android
If you use GNOME then write gksudo instead of sudo and when you use KDE, write kdesu instead of sudo.
ANDROID SETTINGS window will appear. Go to "Available Packages" and install
Code:
Android SDK platform-tools
Android Compatibility package
SDK Platfotm Android XX (select versions you wanna, select at least one - for example 2.3.3)
After things are downloaded and updated, close that Android Settings window.
Log out and log in to complete installation.
CHEERS!!!
If you like this GUIDE, then HIT THX button.
Have a nice day.
Why are you spamming the forum with this unnecessary cruft?
Duh... download file from web.
Extract.
done.
I mean what are you trying to do? Confuse people and drive them by force to apple?
Not everyone is as SMART as(s) you are.
So keep quiet if you have nothing positive to say to this thread.
sudo android
sudo: android: command not found
I also found this script (for ubuntu) very helpful https ://github.com/AdnanHodzic/android-sdk-installer
And it is possible to just install the eclipse plugin as a user, it will pull in the sdk. (Don't forget to install the i386 libs though)
1) Download the Android SDK for Linux and follow Google's setup directions.
2) Drop the ADB binary into /usr/bin.
3) Edit /etc/udev/rules-d/51-android.rules to read your phone.
thanks dude..I`ll try install on my debian..
kalidgate said:
sudo android
sudo: android: command not found
Click to expand...
Click to collapse
+1
HOXnoo8 said:
+1
Click to expand...
Click to collapse
cd into tools and run android
./android
This will open a GUI that allows you to download various APIs and tools such as adb and fastboot
Sent from my Nexus 7 using XDA Premium 4 mobile app

[TUTORIAL] How to make your own APK installer for Windows.

Disclaimer:
Code:
Though it's really not possible bricking your device due to this tutorial, but still if something or the other happens, I'll 100% try to help you but it's not my responsibility. ThankYou
What you need:
1. ADB drivers and some other files to run the tool, since it will be based on adb. Get from my zip.
2. Notepad++(Search for it)
3. Bit knowledge about ADB to avoid non-sense questions.
4. Kindness to press THANKS button.
Ways to do it:
There are 2 basic ways you can make your tool:
1. To install a specific app.
2. To install all the apps from a folder or directory.
Method 1(Make single apk installer):
1. Open notepad++ and write some codes like this:
Code:
ECHO OFF
CLS
ECHO Single-apk installer.
ECHO Press any key to install your apk.
ECHO.
PAUSE
adb install APP.apk
ECHO Done
ECHO.
2. Now save your script as "name.bat". Here replace name with anything but remember the extension will be ".bat"(obviously without quotes).
Now understading this method:
Here you can practically edit or add anything after the ECHO command. Now here, adb install is the basic command we use to install our apps and replace "APP" with your app name, for e.g. if it's RootBrowser.apk so change APP.apk with that. But remeber your app should be in the same directory as the batch script. But if it is in some other directory, then in adb install APP.apk before APP.apk write the complete location of the folder it is in. For e.g. if it is in C:/test/ the write the code as adb install C:/test/RootBrowser.apk and you're done. But if the folder is in the same directory as the tool is then no need for this. For e.g. the folder is test, then change the code to adb install test/RootBrowser.apk and done!!
Note - The PAUSE command is used to stop the tool at that point.
Method 2(Make multi apk installer):
1. Open notepad++ and write some codes like this:
Code:
ECHO OFF
CLS
ECHO Multi-apk installer.
ECHO Press any key to install your apk.
ECHO.
PAUSE
FOR /r %%f in (*.apk) DO adb install "%%f"
ECHO Done
ECHO.
2. Now save your script as "name.bat". Here replace name with anything but remember the extension will be ".bat"(obviously without quotes).
Now understading this method:
The ECHO and PAUSE parts go same as above. Same goes for directory part, but remember for example if your apps are in same directory as the tool but another folder for e.g. INSTALL, then change the code to FOR /r INSTALL/ %%f in (*.apk) DO adb install "%%f" and you will be good to go
Credits:
Soumya_digi for teaching me
Note- Will add some screenshots soon. Please report if this works for your device and don't forget to press THANKS
Re: [GUIDE] How to make your own APK installer for Windows.
Nice...esp. The second method , however i didn't understand the %% part in the second method clearly.....
Nice work though..!!
Sent from my GT-S5360 using xda app-developers app
Re: [GUIDE] How to make your own APK installer for Windows.
anubhavrev said:
Nice...esp. The second method , however i didn't understand the %% part in the second method clearly.....
Nice work though..!!
Sent from my GT-S5360 using xda app-developers app
Click to expand...
Click to collapse
We use %%ff to target all the apps for multiapps
Press THANKS if I helped,
Best Regards,
AJ

Categories

Resources