title: Attempting to gain r/w access to android /system
body: <p>Working on a root script for the Nexus 4 with the latest stock rom .img for google (occam) and I have the following code snippet: </p>
  
  <pre><code>./adb wait-for-device
  echo "remounting system"
  ./adb shell "mount -o remount,rw /system"
  ./adb push su /system/bin/
  echo "pushing super user"
  ./adb push Superuser.apk /system/app/
  echo "pushing busybox"
  ./adb push busybox /system/xbin/
  ./adb shell "chmod 06755 /system/bin/su"
  ./adb shell "chmod 0644 /system/app/Superuser.apk"
  ./adb shell "chmod 04755 /system/xbin/busybox"
  ./adb shell "cd /system/xbin"
  ./adb shell "busybox --install /system/xbin/"
  </code></pre>
  
  <p>I keep getting the error </p>
  
  <pre><code>mount: Operation not permitted
  failed to copy 'su' to '/system/bin//su': Read-only file system
  pushing super user
  failed to copy 'Superuser.apk' to '/system/app//Superuser.apk': Read-only file system
  pushing busybox
  failed to copy 'busybox' to '/system/xbin//busybox': Read-only file system
  Unable to chmod /system/bin/su: No such file or directory
  Unable to chmod /system/app/Superuser.apk: No such file or directory
  Unable to chmod /system/xbin/busybox: No such file or directory
  /system/bin/sh: busybox: not found
  </code></pre>
  
  <p>I've tried using multiple methods of obtaining r/w access, but nothing seems to be working. I have to automate this process due to the fact that other people will use the script so it needs to be automation friendly, but I just can't figure this out. </p>
  
  <p>I've also tried the </p>
  
  <pre><code>#su
  #mount
  #mount | grep system
  </code></pre>
  
  <p>followed by inputting the partition with the system mount and changing it to r/w access, but that also hasn't worked. </p>
  
  <p>Really frustrated at this point. Can anyone help? </p>