title: Porting AOSP to specific hardware device
body: <p>UPDATE: Based on this Here is following question: <a href="https://stackoverflow.com/questions/31505474/create-specific-device-tree-for-aosp">Create specific device tree for AOSP</a></p>
  
  <p>I followed this: <a href="https://source.android.com/source/building.html" rel="nofollow noreferrer">https://source.android.com/source/building.html</a> and set up the environment and downloaded the latest AOSP. Now I wnat to flash it on my specific device, let's say Galaxy S2.</p>
  
  <ol>
  <li><p>In the "Configuring USB Access: 51-android.rules", how it should look? Because in above official tutorial each entry looks like:</p>
  
  <p>//adb protocol for device X</p>
  
  <p>SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="user"</p>
  
  <p>//fastboot protocol for device X</p>
  
  <p>SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="user"</p>
  
  <p>But in many places I found this:</p>
  
  <p>SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"</p>
  
  <p>Of course adding user to plugdev group is obvious, but still: In Google`s way there is separate entries for adb &amp; fastboot, and the mode is different...</p>
  
  <p>What would be the ultimate test to see if this step works?</p></li>
  <li><p>Suppose I modify the correct lines of code &amp; config files for my specific device like stated here: <a href="https://stackoverflow.com/questions/11352709/android-device-configuration-for-aosp">Android device configuration for AOSP</a>. Which means I have a directory with full AOSP files. In the stage of <code>$ lunch aosp_arm-eng</code> what parameters should be for specific hardware device? </p></li>
  <li><p>Now suppose I have in my output directory built &amp; compiled AOSP files. How should I flash it on my device? It's not very clear from Google`s above tutorial. I prefer to get just a single zip file in order to flash it via CWM recovery etc.</p></li>
  <li><p>Is there a way to test the result before flashing it on hardware device (To reduce the chances for brick...)?</p></li>
  </ol>
  
  <p>Thanks, </p>