Hello everyone,
I am really have difficulties with this one, I have been trying over and over and I just haven't succeeded yet, so I came looking and hoping for some help around here .
Like the title say, I need to:
1) Apply patch(diff) with resources.
2) Compile.
The files:
Diff
Resources
I really hope there are someone out there who can take a few minutes or so to help me out, because I am stuck at this myself, I really need some help!
Thanks in advance.
Goto the root of your source code folder (e.g. cd ~/android/system)
apply patch by using:
- "patch -p1 < "
after ">" has to be a "blank space" (press spacebar),
- now drop your patch file in to the terminal window, (this will add the path to the patch file),
- run the created command
- place recources files to:
/<root of your source code folder>/system/core/res/res/drawable-hdpi
i think this require the ROM source code and Programming tools or Linux OS to run.
it not like windows got GUI to let you click in 1 buttom.
more datails please ??
i really like to port iy to my devcice
hope someone can help-me
:crying::crying:
Working with GIT and GITHUB
for Android Source
I want to start by saying that I am no EXPERT on GIT, but I believe the best way to learn is through trial and error. Through my trials and errors, this is what I have found that works when working with Android Source Code (AOSP).
I started my Android Development basically porting and hacking Android Operating Systems for the HTC Thunderbolt. In my opinion I learned the basics plus some, and was able to create stable builds, which most users found enjoyable to operate. In my quest to further improve my Android development skills, I moved on the next step in Android Operating System development, build a custom AOSP ROM from source. I soon started browsing other developers GITHUB repositories and tried my best to figure out what was going on behind the scenes, in order to share my code with others and visa versa. This lead me to setting up a development platform, downloading the latest (at the time ICS) source and then compiling everything, to obtain, a fresh updated ROM. Obviously, the next step was editing the code to my liking and then trying to figure out how to update my code (push) to Github for version tracking and also hosting purposes. I shopped around on the net for GIT tutorials, and for the life of me, I could not figure out how to make things work the way they should. After doing research on the REPO command (which I came to find was basically the same as GIT but updated to work better with Android) I became more confused. I never found an article or tutorial which explained step-by-step the processes in which I am about to explain, which is why I decided to take the time to compose this tutorial.
Finally, through many hours of research and frustration, I came up with the answers I was so diligently seeking. Here are my findings:
The following Tutorial is for an INITIAL COMMIT of your source to GITHUB. Once you accomplish sending the initial data over, sending only changes thereafter, is very similar, but doesn't require as many steps.
Prerequisites:
(1) Create an account on GITHUB.com
(2) Download the Android Source into a working directory (in my case "android").
(3) Generate your Private SSH Keys for GITHUB (this will allow you to push files without logging in every time) You will find easy to understand directions HERE
For this example I will be working with the following variables:
My default Android directory: ~/android
For this tutorial I will editing the Setting.apk source code in order to add "XYZ" functionality
The source code for the Settings.apk is located in ~/android/packages/apps/Settings
So lets BEGIN!
First Step: You want to go into the directory where you are editing the source.
Code:
cd ~/android/packages/apps/Settings
Second Step: Initialize the Settings source folder and create a git repository
(which will track all changes)
Code:
git init
Third Step: Now you want to log-in to GITHUB and create a repository for your updated Settings source to go. In my case I created a folder on GUTHUB called android_packages_apps_Settings
Forth Step: After you have created your repository on GITHUB, from your Settings source folder, you need to tell git where to push the changes you have made. When you do the initial push, it is actually going to push all of the files in the Settings source folder including the changes you have made. Do this by typing the following command:
Code:
git remote add github [email protected]:yourusername/android_packages_apps_Settings.git
Obviously, you are going to change "yourusername" to whatever username you created on GITHUB.
Fifth Step: Add the entire Settings directory to git so that it starts tracking your additions, deletions, changes, etc for the entire directory.
Code:
git add -A
Sixth Step: Commit the changes that you made to the files in order to push to GITHUB. Now for this example, I want to commit changes to ALL files in the Settings folder.
Code:
git commit -a
If I wanted to just commit changes to one specific file, I would use "git commit whateverfile.java". After you commit, a text editor is going to pop-up. This is where you add the description for the change(s) you have made. If you have detailed change-log of each file you changed, you will not want to use the "git -a" command because the description you enter there is going to be the description for all of the files you edited.
Seventh Step: Now you want to change to the branch you plan on using to push your content. In my case its "jellybean".
Code:
git branch jellybean
Eighth Step: Finally you will now push your initial Settings commit to github. In order to do this, type:
Code:
git push github jellybean
This is going to push github ("github" is the name you gave the REMOTE when you executed the "git remote add" above) to a branch on GITHUB.com called "jellybean". You can name the branch whatever you like, but obviously naming it to the current Android release name is the easiest to remember for you and others.
You should now see that your computer sent files to GUTHUB.com and if you check online, you should see that your changes have been implemented and copied for the world to access.
I hope this helps people out with Android based git commands. I wish I found somthing like this months ago and maybe I would have a few extra hairs on my head. Let me know if you have any additional questions or would like me to add to this tutorial in any fashion. I will be doing a video shortly which I will post to this thread when complete.
Saved for Questions and Answers . . .
Create repository on github called packages_apps_Settings
Clone it
Code:
git clone https://github.com/lithid/packages_apps_Settings.git
cd packages_apps_Settings
Find the aosp settings and pull that repo so all proper history is still entact. Then merge it.
Code:
git pull https://android.googlesource.com/platform/packages/apps/Settings refs/tags/android-4.1.1_r6
Save it
Now add it all and push to your local repo.
Code:
git push
Hello, how do you create a device tree because I want to build from source but my phone does not yet have one. Thanks
itzdarockz said:
Hello, how do you create a device tree because I want to build from source but my phone does not yet have one. Thanks
Click to expand...
Click to collapse
When you say "a device tree" are you referring to the propriety device drivers and such for a particular device?
MyComputerDoctor said:
When you say "a device tree" are you referring to the propriety device drivers and such for a particular device?
Click to expand...
Click to collapse
I mean to build from source and when picking your lunch such as crespo and crespo 4G i want to add my phone into that. Is that necessary to build from source though?
itzdarockz said:
I mean to build from source and when picking your lunch such as crespo and crespo 4G i want to add my phone into that. Is that necessary to build from source though?
Click to expand...
Click to collapse
Let me know if this helps: http://www.netmite.com/android/mydr...build_new_device.html#androidBuildNewFileTree
Thanks for this tut! I've been wanting to push out sources to my github for a while...but couldn't really find a good tut/didn't have the time to do all the research...this seems like it should get me going with my github and I will definatly be using this tut soon
Sent from my SGH-I997 using Tapatalk 2
question, Let's say I want to merge a commit from CyanogenMod's GitHub ..... I use AOKP's Source, is there a command using git that I can use to facilitate this ??
johnhany97 said:
question, Let's say I want to merge a commit from CyanogenMod's GitHub ..... I use AOKP's Source, is there a command using git that I can use to facilitate this ??
Click to expand...
Click to collapse
Use git cherry-pick but first you need to add the repo
So for example you want a commit from settings first you add CM's settings as a repo with git remote add <name> <url> ....Name can be anything
So it will be $ git add remote cm https://github.com/CyanogenMod/android_packages_apps_Settings
then you can either git fetch cm which will sync all the branches out you can just sync a single branch $ git fetch cm cm-10.1
Now you can use git cherry-pick to cherry-pick the commit from CM settings
$ git cherry-pick <sha1>
e.g
$ git cherry-pick 64c377
Now you will probably need to resolve some conflicts which is hard to explain how to resolve as it varies between has been added where cherry-picked.
can some one ell me how i merge the halo from PA ?
thanks
MyComputerDoctor said:
Working with GIT and GITHUB
for Android Source
I want to start by saying that I am no EXPERT on GIT, but I believe the best way to learn is through trial and error. Through my trials and errors, this is what I have found that works when working with Android Source Code (AOSP).
I started my Android Development basically porting and hacking Android Operating Systems for the HTC Thunderbolt. In my opinion I learned the basics plus some, and was able to create stable builds, which most users found enjoyable to operate. In my quest to further improve my Android development skills, I moved on the next step in Android Operating System development, build a custom AOSP ROM from source. I soon started browsing other developers GITHUB repositories and tried my best to figure out what was going on behind the scenes, in order to share my code with others and visa versa. This lead me to setting up a development platform, downloading the latest (at the time ICS) source and then compiling everything, to obtain, a fresh updated ROM. Obviously, the next step was editing the code to my liking and then trying to figure out how to update my code (push) to Github for version tracking and also hosting purposes. I shopped around on the net for GIT tutorials, and for the life of me, I could not figure out how to make things work the way they should. After doing research on the REPO command (which I came to find was basically the same as GIT but updated to work better with Android) I became more confused. I never found an article or tutorial which explained step-by-step the processes in which I am about to explain, which is why I decided to take the time to compose this tutorial.
Finally, through many hours of research and frustration, I came up with the answers I was so diligently seeking. Here are my findings:
The following Tutorial is for an INITIAL COMMIT of your source to GITHUB. Once you accomplish sending the initial data over, sending only changes thereafter, is very similar, but doesn't require as many steps.
Prerequisites:
(1) Create an account on GITHUB.com
(2) Download the Android Source into a working directory (in my case "android").
(3) Generate your Private SSH Keys for GITHUB (this will allow you to push files without logging in every time) You will find easy to understand directions HERE
For this example I will be working with the following variables:
My default Android directory: ~/android
For this tutorial I will editing the Setting.apk source code in order to add "XYZ" functionality
The source code for the Settings.apk is located in ~/android/packages/apps/Settings
So lets BEGIN!
First Step: You want to go into the directory where you are editing the source.
Code:
cd ~/android/packages/apps/Settings
Second Step: Initialize the Settings source folder and create a git repository
(which will track all changes)
Code:
git init
Third Step: Now you want to log-in to GITHUB and create a repository for your updated Settings source to go. In my case I created a folder on GUTHUB called android_packages_apps_Settings
Forth Step: After you have created your repository on GITHUB, from your Settings source folder, you need to tell git where to push the changes you have made. When you do the initial push, it is actually going to push all of the files in the Settings source folder including the changes you have made. Do this by typing the following command:
Code:
git remote add github [email protected]:yourusername/android_packages_apps_Settings.git
Obviously, you are going to change "yourusername" to whatever username you created on GITHUB.
Fifth Step: Add the entire Settings directory to git so that it starts tracking your additions, deletions, changes, etc for the entire directory.
Code:
git add -A
Sixth Step: Commit the changes that you made to the files in order to push to GITHUB. Now for this example, I want to commit changes to ALL files in the Settings folder.
Code:
git commit -a
If I wanted to just commit changes to one specific file, I would use "git commit whateverfile.java". After you commit, a text editor is going to pop-up. This is where you add the description for the change(s) you have made. If you have detailed change-log of each file you changed, you will not want to use the "git -a" command because the description you enter there is going to be the description for all of the files you edited.
Seventh Step: Now you want to change to the branch you plan on using to push your content. In my case its "jellybean".
Code:
git branch jellybean
Eighth Step: Finally you will now push your initial Settings commit to github. In order to do this, type:
Code:
git push github jellybean
This is going to push github ("github" is the name you gave the REMOTE when you executed the "git remote add" above) to a branch on GITHUB.com called "jellybean". You can name the branch whatever you like, but obviously naming it to the current Android release name is the easiest to remember for you and others.
You should now see that your computer sent files to GUTHUB.com and if you check online, you should see that your changes have been implemented and copied for the world to access.
I hope this helps people out with Android based git commands. I wish I found somthing like this months ago and maybe I would have a few extra hairs on my head. Let me know if you have any additional questions or would like me to add to this tutorial in any fashion. I will be doing a video shortly which I will post to this thread when complete.
Click to expand...
Click to collapse
Did you finish the video tutorial?
Sent from my LG-LS970 using Tapatalk 4 Beta
sooo?
Does anyone have further information on how you would sync back to a master? That is, if I sync from AOSP today, make my own changes, and then a few weeks from now I want to resync to an updated AOSP, how do I do this?
Hi guys. So I've had a few people PM me and ask for help cherry picking features to build a ROM from source. I've decided I might as well post a guide with what I've gathered. I'll outline the procedure for cherry-picking from both gerrit as well as GitHub, and what to do afterwards.
Once you've completed the guide, feel free to post questions/comments/advice in the thread. If you run into any issues, I will be happy to answer them (along with other helpful members of our community). If you think I should add something to the guide or change something, also feel free to let me know. I haven't noticed any good resource concerning cherry-picking on XDA, so discussion is encouraged.
Before we begin cherry-picking, I'm going to be making a few assumptions. I assume that:
you are using Ubuntu (or another Linux distribution) and you have git installed
you have the source code for your ROM downloaded on your PC
you know how to compile your ROM
you are somewhat comfortable using the terminal
Let's get started!
Table of contents:
1. Cherry-Picking from Gerrit
2. Cherry-Picking from GitHub
3. Conflict Resolution
4. Troubleshooting/After the Cherry-Pick
Cherry-Picking from Gerrit
Cherry Picking a feature from Gerrit
To begin cherry-picking, you should first go to the gerrit for your desired cherry-pick and find its entry/entries. I'll cherry-pick Halo from the ParanoidAndroid gerrit into AOSP.
Because I want Halo, I'll open go to ParanoidAndroid gerrit at http://gerrit.paranoidandroid.co and find the Halo entries. This is what it looks like:
{
"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"
}
You'll notice there are two Halo entries, one titled [1/2] Settings: HALO, and one titled [2/2] Frameworks: HALO. To get this feature, I'll need both, hence the tags 1/2 and 2/2 at the beginning. Here are the links for reference:
[1/2] Settings: HALO
[2/2] Frameworks: HALO
Great, now we have the entries for the two “commits” that we want to add to our ROM. We'll start with the first one. The page may look overwhelming at first, but there are two bits that are most important to us: the Project tag and the Download tab. Here's what they look like:
Look at the project title. It says “AOSPA/android_packages_apps_Settings”. This tells us exactly where in our source code to apply this commit. On my system, I have AOSP downloaded to the folder ~/AOSP. I open a terminal and enter the command “cd ~/AOSP”. Replace “AOSP” with your code directory.
Now, in your terminal, type:
Code:
cd packages/apps/Settings
Now that you're in the right spot, it's time to download the commit and try to apply it. Click the download tab in your browser, then from the dropdown choose “anonymous HTTP” and choose “cherry-pick”. Here's what it looks like:
When you click the clipboard next to the “Cherry-Pick” option, it'll copy to your clipboard. Now, go back to your terminal and press CTRL + Shift + V to paste it.
Code:
git fetch https://gerrit.paranoidandroid.co/AOSPA/android_packages_apps_Settings refs/changes/39/239/14 && git cherry-pick FETCH_HEAD
Chances are, unless you're very lucky, your terminal will do some work and look like this:
To continue, skip to post #4
Cherry-Picking a Feature from GitHub
Cherry-Picking a Feature from GitHub
To begin cherry-picking, you need to find the GitHub “commit” for what you want. A commit is a record of the changes that were made to achieve something, whether it be a new feature or a bug fix.
Today, I'm going to take pure AOSP and cherry-pick ParanoidAndroid's Halo. Because ParanoidAndroid gave up the feature, I can't take it from their GitHub. Conveniently, I have it in my own GitHub and will use that.
Note: you will only find things that have already been added to a project's code on GitHub. ParanoidAndroid gave up on Halo, so it is not added to their code. Because it is not already merged, it will not be in GitHub
First things first, you locate the commit. I know it's in my GitHub, so I'll open that in my browser at http://github.com/jabza-. I already know that Halo requires two commits, one for the settings and one for the frameworks. I'll open the projects “aospa_packages_apps_Settings” and “aospa_frameworks_base”. I'll start with the frameworks.
When you open the page, it's a little confusing. We want to see the commits, so we'll click “commits” toward the top.
Now, I'll have to go down the list to the Halo commit. Here's a link for reference: [2/2] Frameworks: HALO
Note: the commit name has [2/2] at the beginning, showing us that it is the 2nd commit of two. The other is in aospa_packages_apps_Settings
Note: my commit history in aospa_frameworks_base currently has two commits for Halo. The more recent one was a bug fix and I mistakenly left the commit message as it is – you want the older commit for the full change
Scroll down to the bottom of the blue commit message. Below it, there' s a list of the files and the changes made. You may use this for reference later, but it's not important now. What's important is the commit ID, which is listed at the bottom of the commit message.
Now, we go to the terminal. I have my AOSP source in ~/AOSP, so when I open my terminal first enter
Code:
cd ~/AOSP
The project name that we are working from is aospa_frameworks_base. This tells us that the commit belongs in frameworks/base. So, to begin work:
Code:
cd frameworks/base
Now, we have to “fetch” the project so we can cherry-pick the commit.
Code:
git fetch git://github.com/jabza-/aospa_frameworks_base.git
Now that we have the commit history of aospa_frameworks_base, we can tell the terminal to cherry-pick. We must use the commit ID at the bottom that we found earlier. You can copy the commit to your clipboard, and paste it in the terminal with CTRL + Shift + V.
Code:
git cherry-pick ab72e4ab36778474593ffce89150aece01d5f9c6
Obviously, when cherry-picking anything else, replace “ab72e4ab36778474593ffce89150aece01d5f9c6” with the commit ID of that commit.
Now, your terminal will do some work, and it will say it couldn't commit it automatically. It should look something like this:
Now, we get to resolve the conflicts. Continue to the next post.
Resolving Conflicts from Cherry-Picking
Resolving Conflicts from Cherry-Picking
So you've found the commit you want to cherry-pick. You've gone to the right place in your source code to apply it. You've told your computer to apply the cherry-pick. It said it couldn't. Now what?
Well let's see what's wrong.
Code:
git status
Your terminal will now tell you what files have been automatically changed for you and what you need to change yourself. In green are the files that are done, and in red are the files you need to tell it what to do with. Here's what your terminal should look like after “git status”:
If you cherry-picked from gerrit with me and did [1/2] Settings: HALO, it'll look something like this:
If you cherry-picked from GitHub with me and did [2/2] Frameworks: HALO, it'll look something like this:
In looking at the files in red, we see two different tags.
deleted by us – this means that there's a file in the commit that doesn't exist on our computer
both modified – this means that there's a file that was supposed to be modified, but that was modified on our computer from what was expected in the commit
deleted by them – this is a third tag you may see, though it's not here. This means that the commit deletes a file which we stil have on our computer
So, what do we do? Let's start with the ones tagged “both modified”. The first file in red underneath the frameworks/base commit is packages/SystemUI/res/layout/status_bar_expanded_header.xml. We'll open it in our favorite text editor and see what it's all about.
Code:
gedit packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now we search for what's messing with our cherry-pick. It's enclosed in the tags “<<<<<<< HEAD” and “>>>>>>> ab72e4a... [2/2] Frameworks: HALO”. Lines 78-118 look like this:
Code:
<<<<<<< HEAD
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
=======
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
>>>>>>> ab72e4a... [2/2] Frameworks: HALO
Between the <<<<<< HEAD and ======== is code that wasn't expected to be there. Between ====== and >>>>>> ab72e4a... [2/2] Frameworks: HALO is the code that was added in by the commit. Here is where we use our judgement to edit the code to what we need. Because I can see that the code between <<<<<< HEAD and ====== is duplicated by the commit, I can just delete that snippet altogether. We also need to delete the tags added by our cherry pick. In the end, the code looks like this:
Code:
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
Now we can save and quit.
We've resolved the conflict (assuming that was the only one), and now we can mark it as such in the terminal. To do so, we use this command:
Code:
git add packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now, we can do “git status” again and work on the next file we need to modify.
But what about the “deleted by us” files? Well, git is smart. All we need to do is determine if we need those files (hint: unless you really know what you're doing, you do need them). If we need them, git already loaded the files up, so we just have to mark them as resolved by doing
Code:
git add res/values/pa_arrays.xml
You can replace “res/values/pa_arrays.xml” with the rest of the files labeled “deleted by us”. You can also do more than one file at once, like so:
Code:
git add res/values/pa_arrays.xml res/values/pa_strings.xml whatever/files/I/want.java
Continue until you've fixed all the issues.
Note: when you open a file in gedit, it creates a file with the same name but with a ~ added to the end. When you do “git status” these files will show up as “untracked files”. You can either delete them with the command “rm path/to/file.java~” or just ignore them.
Once you do “git status” and all the files turn up green, you have finished resolving the conflicts. Now is the best time to compile your ROM and see if your changes worked. If you're in a rush (or lazy or don't feel like waiting for a ROM to compile or you've already tested it), you can now commit your changes.
Code:
git commit
It'll take you to a screen to write your commit message. It opens it in the in-terminal editor “nano”. You can edit it to say whatever you want, and when you're done press CTRL + X to exit, and then press Y to save the changes. Then your terminal will say you've committed the changes.
Congratulations! You've successfully cherry-picked a commit.
Troubleshooting/After the Cherry-Pick
Troubleshooting/After the Cherry-Pick
Once you've finished adding a cherry-pick, a whole variety of things can happen. You might:
build, and it will stop with some build erros
build, and it will complete, but something will go wrong when you flash it
want to get rid of the cherry-picks altogether
Well, what do you do?
If you build, and it stops building, there will be build errors. Your terminal will tell you what's wrong. Look/scroll up, and there will be something that says:
Code:
path/to/file/problem.java:86: some sort of error ocurred
line.of(code, that causes); a problem {
^
The first thing it says is a file. It will be a path relative to the part it was compiling, so you might have to look for a clue above that to see where it was working on. At the end of the file is a number (in this case 86). That number tells you what line the problem is on in that file. After that, it tells you what the error was that in ran into. Then, it'll print the line that had the error with a carat (^) underneath where it had an issue.
How do you fix it? Just open up the file with something like
Code:
gedit path/to/file/problem.java
and go to line 86 and see what the problem is. Usually it's something pretty straightforward, like mismatched parentheses or a dropped semicolon. Once you've fixed the issue, save the file and build again!
But what about if the build is successful, but it causes bugs in your build? Well, start up your phone plugged into your computer, and use this command:
Code:
adb logcat > errorlog
Once the phone becomes available, your computer will start recording the logcat to the file errorlog. Once you've captured the bug, then you can disconnect your phone and reflash something stable. You can also use CTRL + C to stop the logcat command. Now, you can open the logcat with the command
Code:
gedit errorlog
Reading logcats may take some getting used to. It will take quite a bit of scrolling, but the errors are probably marked with an E at the beginning of the line.
Now, what about if you've got some issues, and you just want to scrap the cherry-picks? Well, it's pretty straightforward. Just use
Code:
repo sync
and all committed cherry-picks will be wiped out and you'll be synced with the source that you're building from/
What if you want to do a repo sync and keep that commit, you ask? Don't worry! Git is smart. It remembers how you resolved the cherry-pick. You can do a repo sync and then cherry-pick again, and it'll automatically try to apply your previous resolution. Neat, huh?
Alternatively, you can fork the project to your own git repository (GitHub accounts are free for students!) and add that to your repo manifest. That's a whole different story, though, and will require extra research.
You should also mention how to cherry pick multiple commits
was looking for a guide like this for modding my build...gr8 guide...
AWSM !!
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
SleepyS40 said:
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Click to expand...
Click to collapse
Cherry-picking multiple commits is pretty straightforward. Once you've resolved any conflicts for one commit, you have to finish by using the command
Code:
git commit
if you want to add another cherry-pick in the same location.
Once you've committed that, you should be able to start the cherry-picking process over again exactly the same. If you have an issue, can you tell me what your terminal says, or post a screenshot?
Walterwhite007 said:
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
To build ParanoidAndroid, you first have to download the source to your computer. So you'd have to make a directory and use "repo init -u http://github.com/AOSPA/manifest.git -b kitkat && repo sync" to start the download. It's a big download, so be ready to wait a couple hours. There's a good guide for building ParanoidAndroid 4+ here
However, as far as forking a repository, you only need to fork the repositories that you want to make your own changes to and keep track of. Really, you don't have to fork anything.
Nicely written.
karanrajpal14 said:
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
+100
Took the workds right outta my mouth!!:laugh::highfive:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Walterwhite007 said:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Click to expand...
Click to collapse
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
jabza said:
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
Click to expand...
Click to collapse
Thanks bro. I tried many times cherry picking halo but that always messed up. Now after following this great guide I'll give it another try !!
Say my name
Thank you so much for the awesome thread..:good:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
I was hoping that someone could help me here so the problem is that I am trying to build OMNI ROM for mako but even after following the guide I dont't see any zip out/target/product/mako. I followed this guide http://docs.omnirom.org/Build_for_mako
xxLeoxx93 said:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
Click to expand...
Click to collapse
- "git commit" tells your computer it's done with editing and finishes the cherry-pick process. That is when git saves your resolution, so that if you go back and cherry-pick that commit again it can automatically apply your resolution to the problem. The ROM will compile without this command, but you won't be able to use "repo sync" to update that project or add any other cherry-picks to that location until you run "git commit" or "git cherry-pick --abort", which removes the cherry-pick altogether.
- When you rebuild the ROM, as long as you don't use "make clean" or "make clobber", it will only recompile the parts that have changed. The next build will go much faster. If you want the builds to go even faster, you should use ccache.