See my other article here for instructions on how to root the Nexus 7 under OSX in the first place.  Some of those instructions are repeated in this post.

Install Android SDK

I know it’s a pain, but really if you’re going to hack around with an Android device you should go ahead and do this.  Additionally, Google has made the process a LOT easier now.

  1. Download the SDK from here.  You probably won’t need them, but instructions are here.
  2. Unzip it into a folder (doesn’t matter where, though if you want to keep it around, somewhere sane).
  3. [Optional] Open Terminal and update your PATH variable by editing .bash_profile and adding the following line:
    1 export PATH=$PATH:/PATH/TO/YOUR/sdk/platform-tools
    4. Re-open Terminal to prepare for the next steps

    Download Requisite Files

    1. Download the Stock Nexus 7 ROM from here (make sure to get the right version, either Wi-Fi or Mobile)
    2. If these links don’t work, just Google for them.  I listed the versions available at the time I wrote this article.

    Prepare for Flashing Stock ROM by Entering Debug Mode

    1. Unpack the ROM image package and extract bootloader-grouper-4.18.img and image-nakasi-jdq39.zip
    2. Copy both files you downloaded above to the **/PATH/TO/YOUR/sdk/platform-tools **directory.
    3. Plug your Nexus 7 into your computer via the USB cable.
    4. You should see an icon appear in the notification area that looks like a Bug (this won’t work under 4.2 until you enable Developer mode): 1. Go to Settings and select About
    5. Tap Build number 7 times (get it?).  It should now say “You are now a developer”
    6. Go Back to Settings
    7. Select Developer options
    8. Check USB debugging
    9. Swipe down your Notification Area and select USB debugging connected.
    10. Make sure the checkbox next to USB debugging is selected.

    Test Connectivity to your Nexus 7

    1. Run adb devices
    2. You should be prompted to grant permission for your Computer to attach to your Nexus 7 (on the Nexus 7 screen)
    3. Grant the Permission
    4. You should see something like:
      1 2 List of devices attached 0183972392402756 device
      5. If you do not, unplug and re-plug in your device and try again

      Flash ClockworkMod Recovery

      1. Run adb reboot bootloader to boot into the bootloader
      2. Run fastboot devices to ensure the device is still seen
      3. You should see something like:
        1 0183972392402756 fastboot
        4. Run **fastboot erase boot** 5. Run **fastboot erase cache** 6. Run **fastboot erase recovery** 7. Run **fastboot erase system** 8. Run **fastboot erase userdata** 9. Run **fastboot flash bootloader bootloader-grouper-4.18.img** 10. Run **fastboot reboot-bootloader** 11. The bootloader should restart 12. Run **fastboot -w update image-nakasi-jdq39.zip** 13. You’ll see something like:
        1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 archive does not contain 'boot.sig' archive does not contain 'recovery.sig' archive does not contain 'system.sig' -------------------------------------------- Bootloader Version...: 4.18 Baseband Version.....: N/A Serial Number........: 015d299480142811 -------------------------------------------- checking product... OKAY [ 0.030s] checking version-bootloader... OKAY [ 0.020s] sending 'boot' (4944 KB)... OKAY [ 0.604s] writing 'boot'... OKAY [ 0.180s] sending 'recovery' (5446 KB)... OKAY [ 0.670s] writing 'recovery'... OKAY [ 0.198s] erasing 'system'... OKAY [ 0.055s] sending 'system' (471804 KB)... OKAY [ 56.262s] writing 'system'... OKAY [ 23.165s] erasing 'userdata'... OKAY [ 1.035s] formatting 'userdata' partition... Creating filesystem with parameters: Size: 14442037248 Block size: 4096 Blocks per group: 32768 Inodes per group: 8176 Inode size: 256 Journal blocks: 32768 Label: Blocks: 3525888 Block groups: 108 Reserved block group size: 863 Created filesystem with 11/883008 inodes and 96825/3525888 blocks sending 'userdata' (137526 KB)... writing 'userdata'... OKAY [ 24.875s] erasing 'cache'... OKAY [ 0.044s] formatting 'cache' partition... Creating filesystem with parameters: Size: 464519168 Block size: 4096 Blocks per group: 32768 Inodes per group: 7088 Inode size: 256 Journal blocks: 1772 Label: Blocks: 113408 Block groups: 4 Reserved block group size: 31 Created filesystem with 11/28352 inodes and 3654/113408 blocks sending 'cache' (9052 KB)... writing 'cache'... OKAY [ 1.648s] rebooting...finished. total time: 108.895s
        14. Finally, make sure the bootloader is locked, run **fastboot oem lock** (this is optional, but required if you want Stock) 15. Run **fastboot reboot**

        Your Nexus 7 should now reboot and be ready to setup as stock.