|
|
Chromium Code Reviews|
Created:
7 years ago by newt (away) Modified:
6 years, 9 months ago CC:
chromium-reviews, craigdh+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, frankf+watch_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionAdd a script for configuring adb for working remotely.
This script forwards ports between the local and the remote
machine allowing the developer to install APKs, run tests, etc
on a local device from a remote machine.
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256769
Patch Set 1 #
Total comments: 1
Patch Set 2 : added auto-update capability #
Total comments: 6
Messages
Total messages: 19 (0 generated)
I thought this would be useful to check into the source tree, mainly to keep up with the various ports that need to be forwarded. I'm not sure the best way for people to use this though. They'll need to copy the script onto their laptop somehow.
https://codereview.chromium.org/120263003/diff/1/tools/android/adb_remote_set... File tools/android/adb_remote_setup.sh (right): https://codereview.chromium.org/120263003/diff/1/tools/android/adb_remote_set... tools/android/adb_remote_setup.sh:39: -R 5037:localhost:5037 \ Could you read these ports out from build/android/pylib/constants.py instead? Maybe even keep the list up to date there? Maybe it would be easier to write this in python then? Or at least provide some help for doing that which does not include grepping or ugly bash-trickses to parse the .py file? Maybe create a helper function in constants.py you could call from here?
> Maybe it would be easier to write this in python then? Or at least provide some help for doing that which does not include grepping or ugly bash-trickses to parse the .py file? Maybe create a helper function in constants.py you could call from here? Tying this to other files would require people to sync Chrome onto their laptops though. Maybe instead of checking this in, you could just upload this script as an attachment on an appropriate wiki or Sites page?
On 2013/12/26 20:17:42, aelias wrote: > > Maybe it would be easier to write this in python then? Or at least provide > some > help for doing that which does not include grepping or ugly bash-trickses to > parse the .py file? Maybe create a helper function in constants.py you could > call from here? > > Tying this to other files would require people to sync Chrome onto their laptops > though. Maybe instead of checking this in, you could just upload this script as > an attachment on an appropriate wiki or Sites page? How about checking this file in, but adding a comment that it's meant to be copied to your laptop? I think it's less likely to get lost and it'll be easier to maintain if it lives in the codebase instead of on the wiki.
On 2014/01/06 15:23:55, newt wrote: > On 2013/12/26 20:17:42, aelias wrote: > > > Maybe it would be easier to write this in python then? Or at least provide > > some > > help for doing that which does not include grepping or ugly bash-trickses to > > parse the .py file? Maybe create a helper function in constants.py you could > > call from here? > > > > Tying this to other files would require people to sync Chrome onto their > laptops > > though. Maybe instead of checking this in, you could just upload this script > as > > an attachment on an appropriate wiki or Sites page? > > How about checking this file in, but adding a comment that it's meant to be > copied to your laptop? I think it's less likely to get lost and it'll be easier > to maintain if it lives in the codebase instead of on the wiki. So, could you then have a web service that generates the file based on values in build/android/pylib/constants.py instead?
On 2014/01/28 20:03:27, nyquist wrote: > On 2014/01/06 15:23:55, newt wrote: > > On 2013/12/26 20:17:42, aelias wrote: > > > > Maybe it would be easier to write this in python then? Or at least provide > > > some > > > help for doing that which does not include grepping or ugly bash-trickses to > > > parse the .py file? Maybe create a helper function in constants.py you could > > > call from here? > > > > > > Tying this to other files would require people to sync Chrome onto their > > laptops > > > though. Maybe instead of checking this in, you could just upload this > script > > as > > > an attachment on an appropriate wiki or Sites page? > > > > How about checking this file in, but adding a comment that it's meant to be > > copied to your laptop? I think it's less likely to get lost and it'll be > easier > > to maintain if it lives in the codebase instead of on the wiki. > > So, could you then have a web service that generates the file based on values in > build/android/pylib/constants.py instead? As in, on-the-fly fetching https://src.chromium.org/chrome/trunk/src/build/android/pylib/constants.py
PTAL. I think this solution will work well. Developers will copy this file to their laptop once, then it'll auto-update itself, keeping everyone up-to-date. I looked at parsing build/android/pylib/constants.py to get the port numbers, but that seems like more work than it's worth, especially for something that's not foolproof anyway.
https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... File tools/android/adb_remote_setup.sh (right): https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:11: curl -f -o "$new_script" "$script_url" || return Macs don't ship with curl, so we should have an error message if not present. https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:47: remote_adb="$2" Could you make this default to just "adb"? I think that should work when adb is in the path on the remote machine.
https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... File tools/android/adb_remote_setup.sh (right): https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:11: curl -f -o "$new_script" "$script_url" || return On 2014/02/07 02:17:24, aelias wrote: > Macs don't ship with curl, so we should have an error message if not present. Ok, I can add that. Though this stackoverflow answer seems to indicate that macs do come with curl http://stackoverflow.com/questions/4572153/os-x-equivalent-of-linuxs-wget ? https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:47: remote_adb="$2" On 2014/02/07 02:17:24, aelias wrote: > Could you make this default to just "adb"? I think that should work when adb is > in the path on the remote machine. I tried this, but it doesn't work for me, since .bashrc doesn't get sourced when running the SSH command on the remote machine. Does something like "ssh laptop 'adb shell ps'" work for you?
OK, lgtm otherwise. https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... File tools/android/adb_remote_setup.sh (right): https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:11: curl -f -o "$new_script" "$script_url" || return On 2014/02/07 02:49:48, newt wrote: > On 2014/02/07 02:17:24, aelias wrote: > > Macs don't ship with curl, so we should have an error message if not present. > > Ok, I can add that. Though this stackoverflow answer seems to indicate that macs > do come with curl > http://stackoverflow.com/questions/4572153/os-x-equivalent-of-linuxs-wget ? OK, never mind then, I must've confused it with wget. https://codereview.chromium.org/120263003/diff/80001/tools/android/adb_remote... tools/android/adb_remote_setup.sh:47: remote_adb="$2" On 2014/02/07 02:49:48, newt wrote: > On 2014/02/07 02:17:24, aelias wrote: > > Could you make this default to just "adb"? I think that should work when adb > is > > in the path on the remote machine. > > I tried this, but it doesn't work for me, since .bashrc doesn't get sourced when > running the SSH command on the remote machine. Does something like "ssh laptop > 'adb shell ps'" work for you? Yes, it does work. That's probably because I have the line ". ~/.bashrc" in my .bash_profile, which I believe is sourced in non-interactive shells. I guess for folks who don't, you could have the command be: ssh "$remote_host" ". ~/.bashrc; $remote_adb kill-server" ?
I'm interested in seeing something like this land. :) Looks like it just needs a small update?
Actually, rereading the review comments, this is just waiting for commit?
The CQ bit was checked by newt@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/newt@chromium.org/120263003/80001
On 2014/03/13 05:13:45, eseidel wrote: > Actually, rereading the review comments, this is just waiting for commit? Yep :) I just lost track of this CL.
Message was sent while issue was closed.
Change committed as 256769
Message was sent while issue was closed.
On 2014/03/13 05:55:38, I haz the power (commit-bot) wrote: > Change committed as 256769 This is making check_licenses step fail, I think you need to update android license files. > 'tools/android/adb_remote_setup.sh' has non-whitelisted license 'UNKNOWN' > > FAILED > > Please read http://www.chromium.org/developers/adding-3rd-party-libraries > for more info how to handle the failure.
Message was sent while issue was closed.
I'm reverting this, sorry
Message was sent while issue was closed.
A revert of this CL has been created in https://codereview.chromium.org/196353009/ by jochen@chromium.org. The reason for reverting is: Script doesn't have a license header. |
