[how to] compile and port win32 apps to Windows RT ARM - Windows RT Development and Hacking

Here's a basic guide on how to port, since some people were asking:
Prerequisites:
Windows 8 (non-RT) development machine
Visual Studio 2012 (Don't know if express will work, but evaluation editions exist here: http://www.microsoft.com/visualstudio/eng/downloads)
dll-to-lib tool (http://forum.xda-developers.com/showthread.php?p=36597774)
Part 1: Getting necessary libs:
(1) On your Windows RT device, copy the .dll files in C:\Windows\System32 to some directory on your development machine (We'll call it C:\rtdev\dlls).
(2) Create a directory on your development machine for the libs (we'll call it C:\rtdev\libs)
(3) Extract the dll-to-lib to your lib directory
(4) Open powershell (run powershell.exe) and navigate to the libs directory
(5) run the lib script against the dlls ("./dll-to-lib.ps1 C:\rtdev\dlls).
(6) If you've never run a powershell script before, you might get a signing error. You can type "Set-ExecutionPolicy Unrestricted" to run the script. Please be aware of the security implications if you choose to do this.
(7) You now have a bunch of libs that tell the linker what functions are available in the DLLs on the Windows RT device. Copy the libs that you need to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\arm". DO NOT OVERWRITE ANY EXISITNG LIBS (repeat: DO NOT OVERWRITE ANY EXISITNG LIBS OR YOU MAY HAVE TO REPAIR/REINSTALL VS) You'll probably have to change the security permissions if you want to copy to this directory, or copy as an administrator.
Part 2: Fixing the compiler.
The compiler won't let you build desktop apps due to a configuration setting. Fortunately, some people at stack overflow figured this out:
http://stackoverflow.com/questions/11151474/can-arm-desktop-programs-be-built-using-visual-studio-2012
Basically, edit:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\ARM\Microsoft.Cpp.ARM.Common.props
to include:
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
before </PropertyGroup>
Part 3: Building a Win32 Hello World app.
Now that we have the libs out of the way, lets build a basic hello world app.
(1) Start Visual Studio 2012.
(2) Create a new project, select Visual C++ (might be under other languages) and pick Win32 Project.
(3) In the wizard, select "Console Application", and press "Finish".
(4) Replace the program body with some text that prints hello world:
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf("Hello World!");
return 0;
}
(5) Add the ARM configuration settings in configuration manager. Goto Build>Configuration Manager, and under "Active Solution Platform" click on Win32 and click New. Select "ARM" under "Type or select the new platform", and press "OK".
(6) Select the "Release" configuration and build the solution (F6). With some luck, some win32 ARM binaries should appear in the ARM subdirectory of your project.
Part 4: Porting Apps
Now that your compiler works, you can port apps over. Most apps that have a VC++ project should port fine just by adding the ARM configuration.
Some apps will have manually set \MACHINE:x86, in which case you will have to change that in the linker options. Also, ARM doesn't support no dynamic rebase, so if you get that error, turn of \DYNAMICBASE:NO in the linker options.
A lot of cross-platform apps will use 'nmake' or the like. For the most part, these apps can be cross compiled using the VS 2012 ARM Cross Tools - you can find that in your start menu- In Windows 8 just type "ARM" and it should show up.
Also some interesting issues might experience:
You might encounter missing symbols from __imp_XXXX or the like from the linker. If it looks like a Win32 function, you just need to explicitly add the .lib (in project properties under Linker->Input->Additional Dependencies, type the name of the lib, which you need to also copy to the VC\lib\arm directory as above. Some common libs include "gdi32.lib" "shell32.lib" and "ole32.lib". You can usually find the .lib under the msdn references: for example this entry for GetUserName http://msdn.microsoft.com/en-us/library/windows/desktop/ms724432(v=vs.85).aspx tells us we can find GetUserName in Advapi32.lib. Also the A and W suffixes just represent the ANSI and unicode version of these functions.
When compiling big libraries like Qt, you might run into some problem about BLX fixups, since relative jumps on arm are limited (23 bits?) I guess they didn't create fixup islands in the MSVC compiler, but I found if you set \INCREMENTAL:NO, that should fix the problem most of the time. Otherwise you might have to add an \ORDER file and manually order things. See stack overflow topic for more details: http://stackoverflow.com/questions/11478055/lnk2013-error-fixup-overflow
Another serious pitfall.. no in-line assembly support in the MS ARM compiler. So you'll have to write in your assembly in a .S file and link to it.
...hopefully this helps someone - happy coding!

no2chem said:
A lot of cross-platform apps will use 'nmake' or the like. For the most part, these apps can be cross compiled using the VS 2012 ARM Cross Tools - you can find that in your start menu- In Windows 8 just type "ARM" and it should show up.
Click to expand...
Click to collapse
I have found with some nmake projects you need to add
Code:
/D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
to your CFLAGS otherwise cl complains about not being able to build desktop arm executables even with the change made to visual studio

& : The term 'dumpbin.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\rtdev\libs\dll-to-lib.ps1:62 char:25
+ $unprocesseddef = &$dumpbin /exports $dllfullpath
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (dumpbin.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Exception calling "Matches" with "1" argument(s): "Value cannot be null.
Parameter name: input"
At C:\rtdev\libs\dll-to-lib.ps1:65 char:5
+ $matches = [System.Text.RegularExpressions.MatchCollection] $regex.Matches($ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
Click to expand...
Click to collapse
Thank you for the tutorial, i currently facing issues on step 5, it seems the script can't access the dumpbin.exe, any suggestion ?

rheza02 said:
Thank you for the tutorial, i currently facing issues on step 5, it seems the script can't access the dumpbin.exe, any suggestion ?
Click to expand...
Click to collapse
You should be running the script on your development machine with visual studio installed

lilstevie said:
You should be running the script on your development machine with visual studio installed
Click to expand...
Click to collapse
i'm running it in my development machine with visual studio 2012 installed, Any idea ?

rheza02 said:
i'm running it in my development machine with visual studio 2012 installed, Any idea ?[/QUOTE
Do you have VS2012 express? Possibly the script will not work if you don't have vs2012 express. Also you need to have $VS110COMNTOOLS set, but VS2012 install should set that for you.
Click to expand...
Click to collapse

To be more clear, you may want to try running the tool from the Visual Studio command line, not just bog-standard CMD (unless you want to set a bunch of environment variable sand such by hand). You should be able to invoke the script by typing powershell <scriptname>

cmd.exe : The system cannot find the path specified.
Click to expand...
Click to collapse
This is the first error when i'm trying to run the script.

rheza02 said:
This is the first error when i'm trying to run the script.
Click to expand...
Click to collapse
looks like you don't have powershell installed. are you running an older version of windows? You can download it here http://www.microsoft.com/en-us/download/details.aspx?id=34595

I'm running windows 8, i can't see any value inside path in my environment variable, do you think it gonna be problem ?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

rheza02 said:
I'm running windows 8, i can't see any value inside path in my environment variable, do you think it gonna be problem ?
Click to expand...
Click to collapse
PATH is under system variables not user variables, have you tried opening powershell from the start screen, and executing the script from within powershell directly?

lilstevie said:
PATH is under system variables not user variables, have you tried opening powershell from the start screen, and executing the script from within powershell directly?
Click to expand...
Click to collapse
same error.

GoodDayToDie said:
To be more clear, you may want to try running the tool from the Visual Studio command line, not just bog-standard CMD (unless you want to set a bunch of environment variable sand such by hand). You should be able to invoke the script by typing powershell <scriptname>
Click to expand...
Click to collapse
it's the same thing, i only have a lot of 1kb files with different name in my libs folder. any suggestion guys ?
Thanks
----------------------------
nvm, I thinks it's working now.

no2chem said:
(6) Select the "Release" configuration and build the solution (F6). With some luck, some win32 ARM binaries should appear in the ARM subdirectory of your project.
Click to expand...
Click to collapse
I keep getting these 3 errors. What's happening?
Thanks...
Edit - the ARM subfolder of the project is empty, which I'm guessing it shouldn't be. How do we fix that?

How do i compile my visual studio project for arm ?, there is no arm option in my build configuration.

Read the OP. You have to select "New" from the "Active solution platform" dropdown and ARM should appear...
Sent from my SCH-I535 using xda app-developers app

jtg007 said:
I keep getting these 3 errors. What's happening?
Thanks...
Edit - the ARM subfolder of the project is empty, which I'm guessing it shouldn't be. How do we fix that?
Click to expand...
Click to collapse
Hm, did you overwrite any of the libs in your VS folder? That might be a problem.. hopefully you have a backup...

jtg007 said:
Read the OP. You have to select "New" from the "Active solution platform" dropdown and ARM should appear...
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
As i said earlier, there is no Arm option under Active Solution Platform > new. any idea ?

no2chem said:
Hm, did you overwrite any of the libs in your VS folder? That might be a problem.. hopefully you have a backup...
Click to expand...
Click to collapse
Yes, I did. Several files had the same name and I replaced them all...
Argh.
Sent from my SCH-I535 using xda app-developers app

jtg007 said:
Yes, I did. Several files had the same name and I replaced them all...
Argh.
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Yikes. I added some instructions warning people not to overwrite.

Related

[DEV] How to compile from the source code for you Android

Greetings everyone...
As you might know: I'm the tech freak guy who compiled the GlibC and some Linux applications for HTC Desire.
As I have published my findings, I've recieved messages about how I'm compiling the applications given the source code. I try to help about this, but sadly I think half of what I say is not understandable without a proper guide. Ergo, this thread will suply this!
When?
Well, soon; because I'm still preparing it.
What will it include?
It'll be a basic guide about how to compile applications with your toolchain (Here is the guide about how to make a toolchain of yourself: How to make a toolchain). I'm planning to show it with GlibC compilation.
What's the extend of this help?
Frankly, compiling from the source sometimes can be quite messy and most of the time, a compilation/configuration line is never same with different applications. However, since most sources come with either Autotools or with a Makefile, most of the times, all you need is to change a few command line variable with a proper value.
I'm not planning to show you the code changes or "patchworks" they might be necessary, because this is quite application specific thing and I'm not an expert about this either. I'm just going to show you a guide about the compilation process.
What's the catch / scum of this help?
There is no catch in it. I just want to help curious nerdy guys like me )), so that we can learn from each other; or maybe improve each others work! I learned a lot from guys here, and I want to help to this community as much as I can as well.
Compilation Guide from Source code
Well, let's begin
We're going to compile the GlibC, with all internals to make it ready. After you prepare this, you might also check DoomLord's post here (http://forum.xda-developers.com/showthread.php?t=1041064) to make a recovery zip to flash this to your device. Make yourself comfortable now; because I'm going to explain everything we use here, thus this might be loong guide
1- Obtain the Sources
First, obtain the sources that you're going to compile. Check all the dependencies of the package and download them (and compile them) before. In our case, since we'll compile GlibC and all it needs is a working toolchain; we don't need to worry about this.
You can obtain GlibC source code from http://ftp.gnu.org/gnu/glibc/ address. Note that, since we're building GlibC for ARM devices and since GlibC seperated ARM support to "Ports" package, we need to download that as well. Make sure you download the same versions of Glibc and Glibc-Ports packages.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2- Extract the Sources, and make a build directory
Extract the sources to some folder; say /home/<user>/Desktop/glibc . Also extract the glibc-ports package to some direcorty, say /home/<user>/Desktop/glibc-ports.
After this, rename the folder "glibc-ports" to just "ports" and then move it inside to the "glibc" folder. If you don't do this step, you'll have "ARM is unsupported" error in configuration step.
Since glibc cannot be compiled from the directory which sources are in it (a restriction made by the developers, to make sources unchanged and ready to be compiled again), we need to make another folder from which we're going to call the compilation tools. Let's say this directory is named as "glibc-build", also at /home/<user>/Desktop .
3- Start "configure"
Now, open a terminal emulator window ( you can use Ctrl+Alt+T keys under Ubuntu to easily open one ). Change into the glibc-build directory.
Code:
cd /home/<user>/Desktop/glibc-build
After this operation, we've to call the glibc's auto-configure script from this folder. Note that ".." is a "special folder name" which denotes the upper level directory (so basicly, we're changing into the upper level in directory tree - Desktop in our case - and then call something from a folder inside that)
Code:
../glibc-2.14/configure --help
When you run the above command, configure will give you the options you can use to configure this package for your needs. Nearly 90% of the time, checking the output of this command gives you the options you need to set to compile properly.
Code:
`configure' configures GNU C Library (see version.h) to adapt to many kinds of systems.
Usage: ../glibc-2.14/configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/c-library]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-sanity-checks really do not use threads (should not be used except
in special situations) [default=yes]
--enable-check-abi do "make check-abi" in "make check" (no/warn/yes)
[default=no]
--enable-shared build shared library [default=yes if GNU ld & ELF]
--enable-profile build profiled library [default=no]
--enable-omitfp build undebuggable optimized library [default=no]
--enable-bounded build with runtime bounds checking [default=no]
--disable-versioning do not include versioning information in the library
objects [default=yes if supported]
--enable-oldest-abi=ABI configure the oldest ABI supported [e.g. 2.2]
[default=glibc default]
--enable-stackguard-randomization
initialize __stack_chk_guard canary with a random
number at program start
--enable-add-ons[=DIRS...]
configure and build add-ons in DIR1,DIR2,... search
for add-ons if no parameter given
--disable-hidden-plt do not hide internal function calls to avoid PLT
--enable-bind-now disable lazy relocations in DSOs
--enable-static-nss build static NSS modules [default=no]
--disable-force-install don't force installation of files from this package,
even if they are older than the installed files
--enable-kernel=VERSION compile for compatibility with kernel not older than
VERSION
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
--enable-experimental-malloc
enable experimental malloc features
--enable-nss-crypt enable libcrypt to use nss
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-gd=DIR find libgd include dir and library with prefix DIR
--with-gd-include=DIR find libgd include files in DIR
--with-gd-lib=DIR find libgd library files in DIR
--with-fp if using floating-point hardware [default=yes]
--with-binutils=PATH specify location of binutils (as and ld)
--with-elf if using the ELF object format
--with-selinux if building with SELinux support
--with-xcoff if using the XCOFF object format
--without-cvs if CVS should not be used
--with-headers=PATH location of system headers to use (for example
/usr/src/linux/include) [default=compiler default]
--with-tls enable support for TLS
--without-__thread do not use TLS features even when supporting them
--with-cpu=CPU select code for CPU variant
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <glibc>.
GNU C Library home page: <http://www.gnu.org/software/c-library/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
The help is quite straightforward, and all explanations are already done. The most important options for our case here is "prefix" and "host". Also, for compilation of GlibC, we need to give "with-headers", "with-tls" and "with-ports" proper values.
"Prefix" is a very important option. This options specifies where the installed binaries and libraries "think" they are. Some binaries and libs. are quite flexible: they don't care about where they are, thus the value of prefix isn't much of importance, but most of the time, it is. Omitting a prefix value here will make PREFIX value of "/usr/local" - which is quite dangerous because it may screw your own system (/usr/local is usually where your own PC applications are - most probably you cannot screw this folder if you're not a super-user but, well, anyway...); so always change this value to something proper when you're cross compiling.
Also, make sure that this path exists in your target device. If you set a prefix, say /cache, and then copy the stuff at, say, /data; it's highly probable that your applications will search for it's config files at /cache, and will complain that they are not found - since they're at /data. Since AFAIK, there is no way to change this in most application after compilation of software, you have to recompile the program to fix such errors (or move the application to the prefix it's set).
I usually use /data as prefix, because I install the stuff to there.
Host is another very important option. If you don't give this parameter, auto-configure will think you're compiling this application for the PC you're using. We've to give "host" the machine specification we're compiling the app for. For ARM based devices, this is mostly something line "arm-xxx-linux" or "arm-linux" or "arm-xxxx-linux-gnueabi" or such.
How do you found this out? Well, simple: If you followed my crostool-ng tutorial and used the same options as I did; your host name will be in "arm-xxxxxx-linux-gnueabi" format. "xxxxx" here is what your vendor name is. If you set a vendor value when making the toolchain, you must write it here. If you left it empty, xxxxx will be "unknown".
The other way to check this is your toolchain's name of gcc command: If your ARM GCC toolchain name is "arm-myvendor-linux-gnueabi-gcc" then, your host name is "arm-myvendor-linux-gnueabi".
Most of the times, there are other options that you must give. As for an example, here is what I generally use to compile glibC:
Code:
../glibc-2.14/configure --host=arm-msm-linux-gnueabi --prefix=/data --with-tls --with-ports="nptl, ports"
I use host as "arm-msm-linux-gnueabi" because this is my cross compile target name.
We set "with-tls" option here: it's for GlibC to support Thread Local Storage. This is a programming scheme that allows threads to have their own storage area; and we give this configuration here to give GlibC a support for this. More info about TLS can be found online in programming wiki's.
We also set "with-ports" because we're also installing some extra plugins for our GlibC install. NPTL is an advanced threading library that supports many advanced features like TLS and such. There is also a "linuxthreads" but it's older. New versions of GlibC is not shipped with "linuxthreads" either. The other port, "ports" is for ARM support.
You must also give the kernel source directory here with a parameter of "with-headers" if you're using some other toolchain and your kernel sources are in some other place. Thanks to crostool-ng that it moves all the headers to the toolchain folder and makes them automatically reachable, so you can omit this parameter.
Well, when you give the command and supply the options and press ENTER, it shall start configuring the package:
When there is a missing dependency or option, it shall generally give you a warning at this step and terminate the configuration. You must then find the solution of this error (install the necessary dependency etc.) and then try to configure the package again - as I said, this is usually not the case for GlibC .
3- Start "make"
After configuration process is done without errors, you can pass to the compilation phase. If you did configuration properly, you don't have to use special parameters and such for most packages. Just issue the command "make" and wait
Code:
make
Once this is completed without errors, you're nearly ready for the shipment Note that, if you get any errors in this process, you should definitely google it; since errors in this level is quite application and build environment (your machines configs. etc.) specific. The errors in this phase is usually needs some tricks to fix, and they are usually not so easy to fix
3- Start "make install"
Once the compilation is successful, you can install the application to the "PREFIX" folder you specified whilst configuring the package. In order to do that, just issue:
Code:
make install
However, issuing just this command isn't what we want generally: Since we've cross compiled the application, we're not interested in installing that to our PC! We want it to be somewhere we can easily access, so that we can distribute easily right?
For most packages, three important variables are necessary to make this. Which variable is heeded is highly dependent of package, however it's DESTDIR usually used.
DESTDIR: The variable usually used in makefiles. When you set DESTDIR while giving "make install", the application becomes installed to DESTDIR/PREFIX folder, instead of just PREFIX folder without changing the prefix info inside the application so it makes it easier for us to distribute the package.
install_root : GlibC uses this variable, instead of DESTDIR. I didn't see any other packages using this.
INSTALL_TOP: OpenSSL and Lua packages use this variable instead of DESTDIR.
Which of these variable is used cannot be identified either without examining the Makefile, or without testing it
How are you going to give it a value? Simple: you just assign the variable a value, after giving "make install" command:
Code:
make install DESTDIR=/home/<user>/myapp
For GlibC, this becomes:
Code:
make install install_root=/home/<user>/glibc
Which makes glibc installed to /home/<user>/glibc folder.
You can take the files from this folder and make a flashable zip; and send it to your device!
5- NOTES
- Be careful about the PREFIX value, you should install the files to this place in your device as well.
- Most of the times, you don't need the "include" folder - this folder keeps the header files for your packages, so that other applications may be compiled with them. Since we're not compiling applications in our device, we don't need headers. Compiled applications don't use headers anymore.
- Most of the times, .a files under the "lib" folder is unnecessary - these are static libraries that are usually used when applications are being compiled. Since we don't compile stuff at our device, we don't need them - they are usually quite big too! Be careful though: some packages don't offer .so files (which are dynamic libraries for applications to use dynamically) - it might be necessary to keep .a files then.
- .la files are needed for application compilation with libraries, you can erase them as well.
- pkgconfig can be erased in distribution packages. PKGConfig is a tool for compilation that automatically parses the files in pkgconfig dirs to give necessary compilation parameters with dynamic libraries to the applications at compile time. Like we don't need headers, we don't need those files.
Well, that's it. I hope I could be of some help. See you next time and happy Android'ing!
< Reserved for other stuff for guide, like hints.. >
Maybe also include a precompiled toolchain for download?
Can do that, but first need to compile a "static" toolchain for this. Actually, this seems like a good idea
Let me work on this next
Nice...big thx...i love such guide´s
with kind regards...Alex
theGanymedes said:
Can do that, but first need to compile a "static" toolchain for this. Actually, this seems like a good idea
Let me work on this next
Click to expand...
Click to collapse
Tried that: The output is huge, and even though the toolchain works without any need to any library, it still needs the libraries to be compiled in order to compile the other binaries - makes sense, since you need the libraries to compile against them anyway
So isn't it possible to package your toolchain which contains gcc, initial glibc and libraries, so that we can download and use them right away? It would save a lot of time and would be a far better option than the ndk.
Sent from my HTC Desire using Tapatalk
Droidzone said:
So isn't it possible to package your toolchain which contains gcc, initial glibc and libraries, so that we can download and use them right away? It would save a lot of time and would be a far better option than the ndk.
Sent from my HTC Desire using Tapatalk
Click to expand...
Click to collapse
That's possible, but only if you're also using Ubuntu 10.10 or 10.04 and a 64-bit machine
For some reason - guess library version differences - toolchains done in 11.10 was not working at 10.04; so I had to redo it, for instance. This technique you say might or might not work - there is no guarantee in it.
Ah well.. I'm using a 32 bit Ubuntu 11.10 on a 64 bit machine. Anyway I have the toolchain I compiled on this one with your help..But if you remember I took a couple of days to get it done, even when I had your excellent help..Newcomers might find it difficult I guess. But if it werent for your toolchain compilation guide in the glibc thread, it'd have been next to impossible!
Droidzone said:
Ah well.. I'm using a 32 bit Ubuntu 11.10 on a 64 bit machine. Anyway I have the toolchain I compiled on this one with your help..But if you remember I took a couple of days to get it done, even when I had your excellent help..Newcomers might find it difficult I guess. But if it werent for your toolchain compilation guide in the glibc thread, it'd have been next to impossible!
Click to expand...
Click to collapse
Thanks Actually, it took me 3 days to make a bootstrap GCC and 8 days to make a Stage 1 GCC when I first began this I could never compile GlibC with those, because of the messy patches needed
I'm never claiming the process to be easy; but believe me: making a toolchain is the most irritating part. Most of the other programs do compile and run just fine, once their dependencies met. Only "very massive projects" like Xorg gives headaches time to time: because normal users do never try to compile those stuff from the source; and because of that, the developers don't try to make the process error-free.
Still, "grep" and knowledge of C makes wonders time to time
Droidzone said:
Maybe also include a precompiled toolchain for download?
Click to expand...
Click to collapse
I have a precompiled toolchain for android, it is in alpha stage with work still ongoing, and needs 2Go of storage. See: http://forum.xda-developers.com/showthread.php?p=43256170#post43256170

[GUIDE]All About ANDROID SDK/AVD {Install/AVDs/Root/ADB}

ALL ABOUT ANDROID SOFTWARE DEVELOPMENT KIT\ANDROID VIRTUAL DEVICE(SDK\AVD)​
What we are going to learn?
What is Android SDK?
Installing SDK
Creating and Managing AVDs
Configuring ADB on your Computer
Root your Android Emulator
Thats It!
Part 1 - What is Android SDK?
​
Android Software Development Kit (abbreviation Android SDK) is an application which allows users to run and manage Virtual Android Emulator.
The Android Software Development Kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development platforms include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8 or later, Windows XP or later. The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) Plugin, though IntelliJ IDEA IDE (all editions) fully supports Android development out of the box, and NetBeans IDE also supports Android development via a plugin. Additionally, developers may use any text editor to edit Java and XML files, then use command line tools (Java Development Kit and Apache Ant are required) to create, build and debug Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely).
Enhancements to Android's SDK go hand in hand with the overall Android platform development. The SDK also supports older versions of the Android platform in case developers wish to target their applications at older devices. Development tools are downloadable components, so after one has downloaded the latest version and platform, older platforms and tools can also be downloaded for compatibility testing.
Android applications are packaged in .apk format and stored under /data/app folder on the Android OS (the folder is accessible only to the root user for security reasons). APK package contains .dex files (compiled byte code files called Dalvik executables), resource files, etc.
Source :- Wikipedia
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
Part 2 - Installing SDK and AVD Manager​
Make sure you have JAVA Installed.....otherwise NOTHING will work...
WINDOWS
1. Download the SDK setup from here > http://developer.android.com/sdk/index.html
2. Install the SDK and choose a short directory to install (C:\....).
3. After you have installed your SDK, Open It and Check Mark the following package :- Tools
4. Wait for it to Download...It will take some time...Be patient...
Click to expand...
Click to collapse
MAC
Go here to get a guide on HOW TO INSTALL SDK ON MAC
Click to expand...
Click to collapse
Here is a video Guide too
Click to expand...
Click to collapse
LINUX
Go here to get a guide on HOW TO INSTALL SDK ON LINUX
Click to expand...
Click to collapse
Part 3 - Creating and Managing AVDs​
1. Go to your android-sdk directory and start/run "SDK Manager.exe"
2. Select the platform that you want to download.
3. Click on "Install X Packages" where "X" is the no. of packages you have selected to download.
4. After downloading has finished which will take around 30 minutes on a descent speed internet select "Tools" from the Main Menu bar
at the top of the window and select Manage AVDs..........
5. A New window will open which is the AVD MANAGER.
6. In the Android Virtual Devices tab SELECT "New" to create a new AVD.
7. Enter the following things:
AVD NAME: Type the desired name that you want for your AVD
Device: Select the AVD resolution as per the device options
Target: Select the Android version you downloaded
CPU/ABI: Select Intel Atom (x86) for 32-bit and ARM (armeabi-v7) for 64-bit.
Keyboard: Check this box if you want to use your keyboard in the AVD
Skin: Check this box if you want to get the hardware buttons
Front Camera: Use this option if you have a webcam and want to use it in the AVD
Back Camera: Use this option if you have a webcam and want to use it in the AVD
Memory Options
RAM: Set this to 768 (maximum for Windows user) or 1024 (maximum for Ubuntu users
VM Heap: Set this to 100
Internel Storage: Set this to 4 and Select "GiB" from this drop down list from side by.
SD Card: Select "Size" and Enter 4 and Select "GiB" from this drop down list from side by.
Emulation Options
Snapshot: Just check mark this option. (Not really neccessary)
Use Host GPU: Check mark this option if you want to use the computers graphics.
*****NOTE: REMEMBER THESE TWO OPTIONS ("SNAPSHOT" and "USE HOST GPU") CANNOT BE USED SIMULTANEOUSLY. IT WILL GIVE YOU AN ERROR.*****
7. Now click OK and wait for few seconds. It will come up with a dialog box which will show you the details of the AVD you created and a message that your AVD has been created.
8. Running the AVD
Highlight the AVD you have created and click "Start..." on the left of the window.
and ENJOYYYY......
Click to expand...
Click to collapse
Part 4 - Configuring ADB on your Computer​
Configuring ADB (Android Debug Bridge) on your Windows allows you to run adb from anywhere. Hence you always do not have to "cd" to the android-sdk directory.
1. Right click on "My Computer" and select "Properties".
2. Go to "Advanced system settings" and open "Environment Variables".
3. Now under System Variables, click "New"
and enter the following details:-
Variable name: Type in ADB.....
Variable Value: Type here the path of your ADB preceeded by a ";" (SEMI-COLON)
FOR EG: If the path to your ADB is (by default) "C:\Program Files\Android\android-sdk\platform-tools\adb.exe"
THEN YOUR variable path would be :" ;C:\Program Files\Android\android-sdk\platform-tools\adb.exe "
AND CLICK "OK".....
4. After having done with this Search for "Path" in System Variables.
5. Double click on it to edit "Variable Value" and add these lines at the end of it:-
;<PATH_TO_YOUR_ADB> where "<PATH_TO_YOUR_ADB>" is the directory where your ADB is located.
6. Save all these changes by clicking "OK".... and you are done .........
NOW YOU CAN TYPE "adb" ANYWHERE IN CMD AND IT WILL RECOGNIZE IT AS A PROGRAM....
Click to expand...
Click to collapse
Part 5 - Root Your Android Emulator​
Want to get more fun on your Android Emulator.....
GET IT ROOTED....
NOTE: YOU MUST HAVE ADB CONFIGURED....... I HAVE TESTED THIS ROOTING METHOD ON API LEVEL 16 ( JELLY BEAN 4.1.2) AND IT WORKS ABSOLUTELY FINE NOT SURE ABOUT OTHERS.....
1. Download the ROOT package from here.
2. Extract the package to somewhere like desktop.
3. Browse to your android-sdk/tools directory and Hold Shift and then right click to get an Advanced Menu. Click on "Open Command Window Here" and type the following command:-
Code:
emulator -avd <YOUR_AVD_NAME> -partition-size 512
NOTE:- DO NOT CLOSE THE COMMAND PROMPT WINDOW OTHERWISE THE EMULATOR WILL CLOSE
4. Now go to Desktop and again hold Shift and right click and Select "Open Command Window Here" and type the following commands one by one:-
Code:
adb connect 127.0.0.1:5554
adb root
adb remount
adb push Superuser.apk /system/app/
adb push su /system/bin/su
adb push su /system/sbin/su
adb push su /system/xbin/su
adb shell chmod 6755 /system/bin/su
adb shell chmod 6755 /system/sbin/su
adb shell chmod 6755 /system/xbin/su
adb kill-server
adb start-server
YOHO............... We are now rooted haha
Click to expand...
Click to collapse
Want to know anything more....Just post it here.....and I'll help you back.... ​
Have I missed something....Please remind me....
Hi
Thanks for this, exactly what i was looking for.
But I find that after I have expanded the /system partition when i restart the AVD it starts with a 211M sized partition. unless i start it from the command line.
Is there any way to change the ini file or the avd manager to start it with 512M /system ?
Also the SU didn't work, I had to grab one of my working phone.. (there was a hex error code)
/system/bin/sh: /system/xbin/su: not executable: magic 7F45
actually spoke way to early no I find the /system partition doesn't save a cross reboots
last edit.
found http://www.ehalm.at/avd-4.3-gapps.php?l=en
has a pre built 4.3 system img with all the goodies installed
Hello and thanks for your OP.
Do you have the binaries for Intel? Intel emulators being way faster, I'd rather root an intel AVD than use ARM.
Also, is there a way to make SU survive reboots? It's very annoying to have to repeat those steps each time.
error: device not found
Thanks for this guide. Had me thinking of how to connect a AVD to adb since there is no USB to physically plug in.
I did try the loopback address, with the right port, but that is as far as I have got:
Code:
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb connect 127.0.0.1:5554
[sudo] password for joel:
connected to 127.0.0.1:5554
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb root
error: device not found
[email protected]:~/Build/android-sdk-linux/tools$ sudo adb devices
List of devices attached
[email protected]:~/Build/android-sdk-linux/tools$
Is there anything I am doing wrong? I know your guide (mostly) is for windows, but it would seem strange for me to emulate Android in an emulated Windows environment (running Debian GNU/Linux v7).
UPDATE: Figured it out, once I used the ./adb command in platform-tools.

[GUIDE] hOw TO Deodex JB firmware (I9070)

GUIDE
This is a guide to help you de-odex your Jellybean odexed firmware.
As X-ultimate is not working on jellybean firmwares and @Agadoo spends a lot of time deodexing every firmware, I thought this guide can help a lot of people including @Agadoo.
THINGS TO REMEMBER :-
1. I AM “ NOT AT ALL RESPONSIBLE” FOR ANY SOFT-BRICKS OR ANY OTHER DAMAGES TO YOUR PC OR PHONE
2. WHEN YOU DEODEX YOUR FIRMWARE, SYSTEM WILL WRITE “.dex” FILES IN /data/dalvik-cache, WHICH WILL REDUCE SPACE IN THAT FOLDER.
3.YOU WILL READ THE WHOLE THREAD CAREFULLY BEFORE DOING ANYTHING.
There is a simple way to deodex your firmware i.e. using universal deodexer (http://forum.xda-developers.com/showthread.php?t=2213235). Here, when I say simple, I mean the download and setup of this program is simple.
But a few features are missing in it. Firstly it cannot zipalign after deodexing the firmware. The second problem is a major problem , as far as I think. We have preload partition and a system partition in our phone. The “.apk” and “.odex” files stored in the preload partition, have symlinks in the system folder. It means there are a few “.apk” and “.odex” files in the system folders which are not actually applications but symlinks of those apps in preload folder. So you need to manually sort them out, which is a real pain in your a**. But don’t worry, the below mentioned method is different.
ANOTHER way to deodex, like Universal deodexer....... Carbonite tool (credits- adityaf) --- http://forum.xda-developers.com/showthread.php?t=2226160 (ty kingbabasula)
***********************************************************************************************************************************************************************************************************************************************************
This method uses android kitchen (by dsixda) to deodex the firmware. SO ALL THE CREDITS GO TO HIM. Original thread ------- http://forum.xda-developers.com/showthread.php?t=633246
Setup looks complex because I have given a detailed explanation on how to do it.
The guide is in two parts. First part in first post and the second in the second post.
PART - 1
PREREQUISITES :- (installing cygwin and android kitchen)
1.LATEST VERSION OF JAVA SHOULD BE INSTALLED ON YOUR PC.
2.CYGWIN……….
Go to (http://www.cygwin.com) and download the LATEST setup.exe file TO AVOID ERRORS. (Remember to install in C:\cygwin) SEE BELOW, HOW TO INSTALL.
************************************************************************************************************
Cygwin instructions for dsixda's Android Kitchen
-------------------------------------------------
1) Run the Cygwin setup.exe and select the defaults for the installation paths, such as:
- install from internet
- install to C:\cygwin
2) At the 'Select Packages' screen, go to the 'Search' box to look for the following package:
* gcc4 (found under 'Devel')
- Click on the '+' symbol at the section it's found under
NOTE:- IN THE SELECT PACKAGE SCREEN, UNTICK "HIDE OBSOLETEPACKAGES" IN BOTTOM LEFT CORNER, AND THEN SEARCH FOR "gcc4".
..................Now it would be found under "_obsolete" and not under DEVEL...... (thanks bob for pointing)
- Then find this single package (only the one with this exact name, not multiple similarly-named ones!) and click 'Skip' once so that it changes to show a version number
Go back to the Search box and repeat the above steps for the rest of the packages:
* libmpfr4 (found under 'Libs')
* perl (found under 'Interpreters')
* cpio (found under 'Utils')
* util-linux (found under 'Utils')
* ncurses (found under 'Utils')
* zip (found under 'Archive')
* unzip (found under 'Archive')
* wget (found under 'Web')
3) Press Next to proceed installing these packages.
4) When installation has been completed, click on your new Cygwin desktop shortcut. This will open a terminal session that will run some initialization.
5) With the Cygwin terminal still open, we need to configure the path to the Java application so that it can be executed within Cygwin.
In the terminal, type the command 'java' (without quotes). If it says 'command not found', then read the below. Otherwise, skip this section.
First, make a backup of your .bash_profile file in case you make a mistake later in this procedure.
Enter the following in the terminal:
cp .bash_profile .bash_profile.backup
Next, find out where your java.exe file is and run the appropriate command to add it to your Cygwin path.
For example, my java.exe is found under C:\Program Files\Java\jre7\bin, so I had to type:
echo "PATH=/cygdrive/c/Program\ Files/Java/jre7/bin:\${PATH}" >> .bash_profile
Modify the command above so that it matches the actual path to your installed Java.
Remember to add a "\" character before any spaces in your path, as shown above.
Type the following so that the file gets loaded (you only need to do this once):
source .bash_profile
There should not be any errors displayed if successful.
(Otherwise, if you made an error in the .bash_profile file, restore your backup by typing: cp .bash_profile.backup .bash_profile, and then try the procedure again)
If done correctly, then when you type 'java' it should display some help information.
6) Your Cygwin is now ready for the kitchen!
************************************************************************************************************
3. Now download the kitchen from dsixda’s github https://github.com/dsixda/Android-Kitchen/tags. (Click the zip option.)
4. Now create a folder kitchen inside C:\cygwin\home\ and extract the kitchen’s zip in that folder. Your kitchen is setup now.
View the next post for deodexing
Credits:
1. Cygwin
2. dsixda
3. BOBFRANTIC FOR REPORTING
PART -2
HOW TO DEODEX :-
Requirements……………….
1. Download this zip file which contains two windows application files and updater script. LINK------ http://db.tt/T9Tooxy8
a. Linux disk internals - Install this file.
b. SGS2ext - Just keep it.
c. META-INF - Just keep it.
2. WinRAR
Procedures…………………….
1.Download the Samsung firmware that you want to deodex and Extract the “system.img.md5” and “hidden.img.md5” from the firmware(.tar.md5) with WinRAR. I suggest you extract it in new clean folder. Just minimize this folder.
2.Now right click SGS2ext.jar and open it with java. A window will open. Now drag the system.img.md5 (that you have extracted) from the minimized folder to this window. Let it complete fully. After that reopen SGS2ext do the same with hidden.img.md5. You will get two files in that folder i.e. “system.img.ext4.img” and “hidden.img.ext4.img”.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3.Make a folder by name “WORKING_deodex” inside C:\cygwin\home\****\kitchen\. The word “WORKING_” should be in capital letters. Copy the META-INF folder that you downloaded to the “WORKING_deodex” folder. Create two new folders inside “WORKING_deodex” folder namely “system” and “preload”.
4.Search and Open the application “DiskInternals Linux Reader”. Select mount image from the left pane. Select raw disk images and click next. Browse and select “system.img.ext4.img”. This file will then be mounted. Inside the mounted folder, click only the “app” and “framework” folder and save it inside C:\cygwin\home\****\kitchen\WORKING_deodex\system
Do the same with with “hidden.img.ext4.img” file. But this time after mounting, save only the symlink folder to C:\cygwin\home\****\kitchen\WORKING_deodex\preload.
5. Now open cygwin terminal from desktop. Remember to run this as an administrator.
Then type “cd kitchen”.
Now type command “./menu”. You will enter android rom kitchen.
Go to “advanced options” and select deodex files.
IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16" as we are deodexing 4.1.2 firmware. (THANKS BOB AGAIN)
Then Deodex both app and framework folders.
Android kitchen will do the rest automatically. It will take a few minutes to complete.
6. After that go to
C:\cygwin\home\****\kitchen\WORKING_deodex\META-INF\com\google\android and open the updater script with notepad++.
In this file check if all the “.apk” files in preload partition are symlinked. Otherwise just add following line with the apk name from preload.
For example if there is Gmail.apk inside preload, then to symlink it write :-
symlink("/preload/symlink/system/app/Gmail.apk", "/system/app/Gmail.apk");
7. Now select the option to create a rom from working folder and select interactive mode.
It will first zipalign rom, compress it and sign the zip file.
Then transfer it to your sdcard and flash the file.
8. You can also push the files via adb
If you face any problem report it…………
Save @Agadoo’s data plan……
Reserved
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Wait, the gcc4 has become obsolete. Wait till i update the post. thanks for reporting.
EDIT:- In the screenshot you posted, untick the hide obsolete packages and then search for gcc4. But it wont be under devel, it will be under obsolete package. (remember that)
bobfrantic said:
Thanks for this, appreciated. I am running into a puzzlement right from the start. When I get to the select packages part of the Cygwin Setup and search for the first package gcc4 there is nothing to select. I noticed before this step you have a bunch of sites to download from. I selected the first. See screenshot.
View attachment 2087910
Click to expand...
Click to collapse
Updated 1st post. See the steps again.
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.<init>(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input '<EOF>'
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input '<EOF>'
WARNING: Unable to produce classes.dex!
that's where I am at so far
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
bobfrantic said:
Ok not able to deodex. Tried moving SecEmail files from preload to apps. Spent enough time today so will try another day. Your guide is most appreciated. This problem is the result of something else going on.
Sent from my GT-I9070 using xda app-developers app
Click to expand...
Click to collapse
bobfrantic said:
Deodex working ok, but with the SecEmail there is a problem and can't deodex that. So haven't been able to go further than deodexing so far.
Error occured while disassembling class Lcom.android.email.activity.setup.AccountSettingsHtmlSignatureFragment; - skipping class
java.lang.RuntimeException: regCount does not match the number of arguments of the method
at org.jf.dexlib.Code.Format.Instruction35c.checkItem(Instruction35c.java:160)
at org.jf.dexlib.Code.Format.Instruction35c.(Instruction35c.java:69)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3681)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1106)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:294)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:116)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
Assembling into classes.dex ...
java -Xmx512m -jar smali.jar -a 17 -o classes.dex out
out\com\android\email\activity\MessageCompose.smali[0,-1] no viable alternative at input ''
out\com\android\email\activity\setup\AccountSettingsHtmlSignatureFragment.smali[0,-1] no viable alternative at input ''
WARNING: Unable to produce classes.dex!
that's where I am at so far
Click to expand...
Click to collapse
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
anantttt said:
I AM EXTREMELY SORRY. I FORGOT ONE IMPORTANT THING. IN THIS SCREEN AFTER SELECT THE OPTION "v" TO SET API.
SET API TO "16".
THEN TRY TO DEODEX.
Click to expand...
Click to collapse
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
bobfrantic said:
That was gonna be my next question. I saw something in the build.prop saying sdk 16 so wondered. thanks for the info. guess you will update things.
Click to expand...
Click to collapse
Already updated. See OP.
It worked. will finish rest tomorrow but deoxed fine.
Sent from my GT-I9070 using xda app-developers app
Oh that is great!!! So I think the guide is complete now.
Tell me if the updater script is working properly.
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
lobotwister said:
$ echo"PATH=cygdrive/c/Program\Files/Java/jre7/bin:\${PATH}">>.bash_profile
cygwin warning:
MS-DOS style path detected: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}
Preferred POSIX equivalent is: echoPATH=cygdrive/c/Program/Files/Java/jre7/bin:${PATH}
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
-bash: echoPATH=cygdrive/c/Program\Files/Java/jre7/bin:${PATH}: No such file or directory
when I try to put the address of java appears the inscription above, and when I go into the kitchen and I type. / menu says that java is not installed.
what am I missing?
Click to expand...
Click to collapse
Do you have java installed?????
If not install the latest version of java and then try this command.
bobfrantic said:
Finished. Made the deodexed zip, followed the prompts in kitchen. Zipaligned, checked the update-script all was good. Signed zip took a bit of time, renamed it and put into my sd card. Started from scratch on phone with fresh install of XXLQG firmware, installed cocafe's 6.8 kernel/cwm, installed my deodexed firmware zip and phone rebooted fine and is deodexed. Preload, symlinks, apps, framework all are correct. Thanks for the guide and I can't think of anything else to add other than be patient, some steps take a while.
Click to expand...
Click to collapse
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
anantttt said:
Well yes. Signing takes a bit of time. You can skip signing if you want.
Now, one more question. Totally off topic
Will you challenge Agadoo, in uploading the deodexed firmware.
Click to expand...
Click to collapse
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
bobfrantic said:
Actually I have pretty well every deodexed firmware on my puter. I was thinking of starting a thread with all in one location instead of how it is now with them spread all over the place LOL. Whatcha think? Good idea or not...
Click to expand...
Click to collapse
Good idea. But frapeti already has a thread in the dev forum.
And one more thing, after deodexing in the build.prop add these lines. Saw it in frapeti's thread.
LINK--- http://forum.xda-developers.com/showthread.php?t=1437799
anantttt said:
Do you have java installed?????
If not install the latest version of java and then try this command.
Click to expand...
Click to collapse
I do have java installed, but I can not make the program recognize the path to the folder of it, with all methods we have deodex forum I always have this problem with java, I do not know what else to do, just will not.
Uploaded with ImageShack.us

[Test Automation Tool] [Android] MonkeyRunner on Eclipse [RHBROMS]

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This will be a Full Tutorial on MonkeyRunner Android Automation Tool
I will be updating this thread as I get time. SO NO ETA's.
Click to expand...
Click to collapse
If anybody wants to use / copy this tutorial to their Website or Blog please feel free to contact me at my personal email id: [email protected]
or at our official Website: www.rhbroms.com
Click to expand...
Click to collapse
Please Click on Thanks button if this tutorial by me had helped you for some extent !!!
Click to expand...
Click to collapse
Table of Contents:
1. Monkeyrunner
2. What all we need before we get it started?
3. How to setup monkeyrunner in Eclipse?
4. How to write and execute monkeyrunner Script?
5. Limitations of monkeyrunner ​
monkeyrunner
1.monkeyrunner​
monkeyrunner is a automation tool which provides us to conduct BlackBox testing on android applications.
The monkeyrunner tool provides a Python API for writing programs that control an Android device or emulator from outside of Android code.
With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation.
The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.
2.What all we need before we get it started?
We need the below:
1. Windows 7/8 OS
2. Java 6
3. Eclipse
4. Android device running min android version 2.3.4*
5. Python
6. Jython
7. Application to be tested
*Are not mandatory.​
DOWNLOADS:
SimpleCalc app sourcecode: SimpleCalc
3.How to setup monkeyrunner in Eclipse?​
1. First download Python from this site: http://www.python.org/getit/
2. Second download Jython.jar file from this site: http://www.jython.org/downloads.html
3. Download the Jython Installer from this site: https://wiki.python.org/jython/DownloadInstructions
3. After downloading the above files install Python.
4. Basic Install for Jython:
After downloading Jython installer, either double click the jython_installer-2.5.2.jar or run java with the -jar option
java -jar jython_installer-2.5.2.jar
Click to expand...
Click to collapse
5. Now after completion of this we will move to Eclipse and download PyDev from Eclipse market place as shown below:
6. When finished install, Go to Window->Preferences->PyDev->Interpreters
- Jython interpreters : Click [new...] and got o the path where you have installed Jython. For me it is at C:/jython/jython.jar
- Libraries : Click [New Jar/Zip(s)] and enter your ANDROID_SDK_PATH/tools/lib/monkeyrunner.jar
as shown below:
7. After this Go to Window->Preferences->PyDev->Interpreters->
- Python interpreters : Click [new...] and got o the path where you have installed Python. For me it is at C:/Python33/python.jar
as shown below:
4. How to write and execute monkeyrunner Script?​
1. Go to File-> New -> PyDev Project -> Give any project Name and select Jython as shown below:
2. Now right click on the newly created project -> New -> PyDev Module
3. Give any Name to the project but leave the package field empty as shown below:
4. After this Just copy paste the below code:
'''
Created on Dec 11, 2013
@author: RHB
'''
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
# Installs the Android package. Notice that this method returns a boolean, so you can test
# to see if the installation worked.
device.installPackage('C:/Users/rhb/workspace/SimpleCalc/bin/SimpleCalc.apk')
# sets a variable with the package's internal name
package = 'com.rhb.simplecalc'
# sets a variable with the name of an Activity in the package
activity = 'com.rhb.simplecalc.MainActivity'
# sets the name of the component to start
runComponent = package + '/' + activity
# Runs the component
device.startActivity(component=runComponent)
# Presses the Menu button
device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
# Enters the value 12 into the first edit text box
device.type('12')
# clicks on the second edit test box of SimpleCalc application that i have provided at the beginning of the post.
device.touch(87,448,'DOWN_AND_UP')
# Enters the value 3 into the second edit text box
device.type('3')
#Clicks on the multiplication button
device.touch(386,650,'DOWN_AND_UP')
# Takes a screenshot
result = device.takeSnapshot()
# Writes the screenshot to a file
result.writeToFile('C:/Users/rhb/workspace/SimpleCalc/shot1.png','png')
Click to expand...
Click to collapse
5. Before executing the above code make sure that you have installed the SimpleCalc app to your device. To do this you can use the below adb command:
adb install SimpleCalc.apk
Click to expand...
Click to collapse
7. To execute this we need to do some customization as explained below:
7a. Go to Run-> External Tools -> External Tools Configurations... . as shown below:
7b. Now select Location as monkeyrunner.bat. Select your working Directory and also write arguments as shown below:
8. Click on Run button and you are good to go
got error while execution
Hi,
I am new to android testing,
i have followed all above steps and it was perfect. but while executing same code i got an error.
Please guide me how to solve.
error occured while executing
Can't open specified script file
Usage: monkeyrunner [options] SCRIPT_FILE
-s MonkeyServer IP Address.
-p MonkeyServer TCP Port.
-v MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF)
Thanks
foodland said:
Hi,
I am new to android testing,
i have followed all above steps and it was perfect. but while executing same code i got an error.
Please guide me how to solve.
error occured while executing
Can't open specified script file
Usage: monkeyrunner [options] SCRIPT_FILE
-s MonkeyServer IP Address.
-p MonkeyServer TCP Port.
-v MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF)
Thanks
Click to expand...
Click to collapse
Enclose your argument statement with double quotes ( " " )
MonkeyRunner, MonkeyDevice in ecllipse error
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
MonkeyRunner, MonkeyDevice
Error occurred in eclipse, due to the above two commands. Please help me solving the issue
How to Drag in Monkey Runner
Not Able to drag using monkey Runner Please see what i have done wrong
device.drag((420,1090), (420,1490),6.0, 520)
Local path doesnt exist error
Hello,
When i am running the above script as you showed, I get this error "Local path doesnt exist". do i need to place apk file in the pyhton project?
how to draw circle or square using monkey runner script ?

[SCRIPTS] ROM, kernel, anykernel updater and Environment-setup scripts

Hey guys
I've been working on some scripts to automate my work for quite some time now and thought, why not share it?
So that's what I'm gonna do now
For now, we have three scripts: one to build a ROM, one to compile a kernel, to make an anykernel updater zip and to set up and entire build environment on Arch and Ubuntu-based distros (2nd post). The kernel and anykernel scripts, however, are linked, which means the kernel script automatically executes the anykernel script so as soon as you compile a kernel, you get a recovery flashable zip.
A small note: These scripts were made for the LG Optimus 4x HD, but can easily be modified for any other device.
So, you may ask yourself now 'nice, but what do these script do exactly?' well, that's what I'm gonna tell you now
ROM
The ROM build script can be found HERE
This script is made for CM 11, but can be easily modded to be used with other ROMs. I will also add some more scripts to support more ROMs in the future.
In order to make it compatible with your machine and your device, we have several configurable parameters in the beginning of the script:
Code:
# Configurable parameters
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
If you want to use a special ccache dir, you can define it using the first parameter. Same for ccache's log.
The "jobs_sync" variable defines how many jobs will be running at the same time while running "repo sync" (---> the -j value)
The "jobs_build" variable defines how many jobs will be used for the make command
"rom" defines the ROM you are trying to compile (used in the lunch command, but also for the zip upload command)
"rom_version" defines the version of the ROM. You can change it to 10.2 or any other version depending on the CM version you are compiling.
Last but not least, the devices codename. In my case it's "p880", but you can just change it to your device (mako, hammerhead, maguro,...) and the lunch as well as the upload command will be changed to your device.
About the upload, if you have a goo.im account and also configured it in your ssh_config, you can just leave it the way it is. However, if you use a different file hoster, please edit the last command to your needs
Furthermore, we have some more features. These, however, don't need to be defined inside the script, but added to the execution command.
You can execute the script with the command:
Code:
. build.sh [-h -n -r -c -ncc -d -j #]
But what do these flags do?
Code:
-h | --help
shows a help message and exits the script
Code:
-n | --nosync
skips the "repo sync" command
Code:
-r | --release
uploads the build when it's done
Code:
-c | --clean
executes "make clean" instead of "make installclean"
Code:
-ncc | --no_ccache
disables ccache
Code:
-d | --debug
shows some debug stuff (not really needed for the "normal" user )
Code:
-j #
sets a custom number of jobs for the "make" command
Example:
Code:
. build.sh -c -r
This command syncs the repos, executes "make clean" instead of "make installclean" and uploads the build to the defined file hoster as soon as the build is done.
Kernel
The kernel build script can be found HERE
This script is made for the p880 (aka x3), but can be easily modded to work with your device.
We have 2 configurable parameters in the beginning of the script:
Code:
defconfig=cyanogenmod_x3_defconfig
jobs=32
"defconfig" defines the name of your defconfig to be used
And "jobs" defines the -j value to be used for make
All modules are being copied to ./out/modules/ and the zImage is being copied to ./out/zImage. Which means no more searching for modules inside the various folders, but having everything in one place
If you take a look into the script, the created out dir is after the above command copied to "~/smb/kernel/out". This is where my network drive is mounted. Please change it to a path of your choice.
This folder now needs to have the files from the anykernel folder inside, because the anykernel build script is being executed next. What this script exactly does will be explained later.
When the anykernel updater zip is done, the script cd's back to the place it was initially executed and will then be done.
If you don't want to make an anykernel zip, just remove the commands after
Code:
find -name '*.ko' | xargs -I {} cp {} ./out/modules/
(well, maybe except for the commands that tell you the script it done )
Anykernel updater zip
Wanna know what an anykernel updater zip is?
The anykernel updater zip only replaces the actual kernel (zImage) and not the whole boot.img. This means the ramdisk stays the same, which makes the kernel compatible with every ROM and Android version.
The script and it's needed tools can be found HERE
This script creates an anykernel updater zip from a given zImage and modules. The zImage has to be in the same folder as the script itself. The modules have to be in a folder called "modules", which also should be located in the same folder as the script. In the beginning of the script, you can define the name of the zip:
Code:
zipname="WWJB_v009_anykernel.zip"
IMPORTANT:
Please make sure to edit the updater-script so it is compatible with your device! Otherwise you can (hard) brick your device!
I am not responsible for possibly bricked devices!
Another feature of the anykernel updater is, you can mod the ramdisk while flashing (repacking the boot.img). This can be done inside THIS file. By default it creates an unsecured boot image. But you can edit way, way more using this method. For an example what can be done, you might wanna take a look at THIS file
The signapk.jar and the sign keys were taken from the latest CM11 sources.
You have a question, suggestion, bug report? Please feel free to leave a reply in this thread
Many thanks go to @GermainZ and @doixanh for helping me fighting with bash
Thanks also go to Koush, for "inventing" the anykernel updater
Environment setup script
Who is bored of setting up an entire build environment for Android? I certainly am, which is why I wrote this "tiny" script
This script sets up a complete build environment, so you can directly start to repo sync a ROM after the script is done. And the best thing is, it is extremely customizable without even having to edit the script itself. All done by appending the appropriate flags to the executing command.
A further big advantage of this script is, that it is compatible with the two most common Linux distros Arch Linux and Ubuntu (also including all distros that are based on these 2, like Xubuntu, Lubuntu,....). This compatibility is achieved by detecting the distro in the beginning of the script and then using the appropriate commands (apt-get or pacman).
The script is located HERE and called "setup.sh"
To run the script, cd to the folder the script is located and enter ". setup.sh" and append all desired flags. If you need help, just append the "-h" or "--help" flag and some help will be shown.
So, you may ask yourself now "That's nice, but what the hell does this script install/set up?" and the answer is quite simple: All you need, and (if desired) even more
The "base package" includes:
Ccache
Java
GIT
All needed build tools
Python 2
The Android SDK
Furthermore, you can also choose the "extended package" by appending the flag "-e" or "--extended", which includes:
SSH
iostat
bmon
htop
geany
The dev-host commandline tool by GermainZ
udev-rules (on Arch only)
If this still isn't enough for you, you can also add your own packages. This can be done by either editing the script and entering the packages inside the quotes of the following line:
Code:
extra="" # Add here some extra packages to install
OR
by appending the flag "-s" or "--special" and then listing the packages within quotes, seperated by spaces.
Example:
Code:
. setup.sh -s "package1 package2 package3"
This script is made to perform all actions on its own, however, it will not do so by default. To have it automated, you need to append either "-a" or "--automated". The script will then install the "base package" with all default packages (such as Oracle's JDK 6).
But you can still also append the other flags, like "-e", "-s", "-j",...
Now, let's talk about Java. This script can install 3 Java versions: Oracle's JDK 6, openJDK 6 and openJDK 7. The default version is Oracle's JDK 6. You can change the version by either appending the "-j" or "--java" flag followed by the desired version (1, 2 or 3), or if the -a flag isn't triggered, the script will ask you about it.
What? You don't want to install/change java at all? No problem! Just append "--no-java" and Java will get completely skipped.
The same thing also happens to the SDK when appending "--no-sdk".
The script has been tested on (X)ubuntu 13.10 and 14.04 by @nilse and me, and on Arch Linux by @SMillerNL and me. However, I have only tested Oracle's JDK 6, no other java versions but according to the wiki pages, it should work just fine
You have suggestions, feedback, improvements? Shoot! Just let me know and I'll do my best to include it
A big thanks goes to my testers @nilse and @SMillerNL who also made some nice suggestions. But also to @GermainZ for his dev-host commandline tool
Furthermore to @eagleeyetom for giving me the idea
Thanks awesome work it will be helpfull i was looking for such thing yesterday XD you're best @laufersteppenwolf
The anykernel script doesn't work on newer devices with zImage-dtb right?
Doesn't look like it based on the script, but I've had trouble with the M8 DTB so figured I'd ask.
u saved my life thanks buddy i will try it !!!
Hi
Fits ics?
xboxfanj said:
The anykernel script doesn't work on newer devices with zImage-dtb right?
Doesn't look like it based on the script, but I've had trouble with the M8 DTB so figured I'd ask.
Click to expand...
Click to collapse
To be honest, I have no idea
I have only tested it on the 4x HD myself, but if you use all the same commands as the the ROM build process does (maybe also grab the needed files) it should work. I mean, it does exactly the same thing as when the ROM build packs the boot image, it puts the zImage and ramdisk into one file. Only anykernel does this on the device itself, rather than on your PC.
If you want, we can take a look into it together
Marília de Oliveira said:
Fits ics?
Click to expand...
Click to collapse
Sure, should work with all ROMs, just edit some stuff (like rom_version=11 to rom_version=9 when compiling CM) and it should work just fine
laufersteppenwolf said:
To be honest, I have no idea
I have only tested it on the 4x HD myself, but if you use all the same commands as the the ROM build process does (maybe also grab the needed files) it should work. I mean, it does exactly the same thing as when the ROM build packs the boot image, it puts the zImage and ramdisk into one file. Only anykernel does this on the device itself, rather than on your PC.
If you want, we can take a look into it together
Sure, should work with all ROMs, just edit some stuff (like rom_version=11 to rom_version=9 when compiling CM) and it should work just fine
Click to expand...
Click to collapse
How do I edit? Can you explain me better .. Thanks
Thanks a lot @lauferstppenwolf
Really takes the stress out of executing commands during my kernel compiles.
Marília de Oliveira said:
How do I edit? Can you explain me better .. Thanks
Click to expand...
Click to collapse
open in notepad or gedit or whatever and edit what u want
BTW does -j number of jobs should be for example "-j6" or "-j 6"?
Marília de Oliveira said:
How do I edit? Can you explain me better .. Thanks
Click to expand...
Click to collapse
It's quite simple, open the script with an editor (I personally like Geany) and edit the following lines:
Code:
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
example:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
and you're already done Your script can now compile CM9 for the Nexus 5
laufersteppenwolf said:
It's quite simple, open the script with an editor (I personally like Geany) and edit the following lines:
Code:
ccache_dir=/home/laufersteppenwolf/ccache/CM11
ccache_log=/home/laufersteppenwolf/ccache/CM11/ccache.log
jobs_sync=30
jobs_build=20
rom=cm
rom_version=11
device_codename=p880
example:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
and you're already done Your script can now compile CM9 for the Nexus 5
Click to expand...
Click to collapse
I have done everything ... where else do I put the script?
Marília de Oliveira said:
I have done everything ... where else do I put the script?
Click to expand...
Click to collapse
just put it inside the root of your sources (the place where you have initiated the repo) and then run it using ". build.sh [flags]"
laufersteppenwolf said:
just put it inside the root of your sources (the place where you have initiated the repo) and then run it using ". build.sh [flags]"
Click to expand...
Click to collapse
Thanks ... Worked in xperia mini pro with ics :good:
gerciolisz said:
open in notepad or gedit or whatever and edit what u want
BTW does -j number of jobs should be for example "-j6" or "-j 6"?
Click to expand...
Click to collapse
Sry for the late reply, haven't seen it at all
it's "-j x", as it only listens to the things behind the actual flag
laufersteppenwolf said:
Sry for the late reply, haven't seen it at all
it's "-j x", as it only listens to the things behind the actual flag
Click to expand...
Click to collapse
thx after reading that script i know now i thought it is same like brunch/lunch -jx
Alright guys, a big update just found its way to github: a script to set up a complete build environment on Ubuntu and Arch-based distros.
If you want me to add support for another distro, please contact me either via PM or via IRC (#TeamFun or #p880-dev) and give me details on what must be changed (install command, packages, ...)
Also the kernel script got some updates, to abort the script if the kernel didn't compile and to copy the anykernel zip directly to dropbox to share it with your testers
Cheers
laufersteppenwolf said:
You want to compile CM9 for the Nexus 5 (codename hammerhead) on a dual core CPU and your username (on your PC) is username:
Code:
ccache_dir=/home/[COLOR="Red"]username[/COLOR]/ccache/CM11
ccache_log=/home/[COLOR="red"]username[/COLOR]/ccache/CM11/ccache.log
jobs_sync=[COLOR="red"]5[/COLOR]
jobs_build=[COLOR="red"]3[/COLOR]
rom=cm
rom_version=[COLOR="red"]9[/COLOR]
device_codename=[COLOR="red"]hammerhead[/COLOR]
Click to expand...
Click to collapse
couldnt you make the script universal by using $HOME?
Wow! Great job and well written... I'll be trying this on my old archserver box that I thought I would have to convert to Ubuntu because I couldn't get all the required packages configured correctly. Looking over your scripts you've touched it all!
Thanks a bunch for the scripts, especially the env-setup one. I'll test it one of these days in Manjaro.
However, env-setup/setup.sh has a small bug: after running the script in LM16 (build environment already set up) it wants to reinstall Java no matter which flag is given.
Also, it doesn't detect installed SDK for some reason.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Categories

Resources