Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,820 Members 49,149 Now Online
XDA Developers Android and Mobile Development Forum

self-contained sideloading, adb stupid tricks version. no PC required.

Tip us?
 
tarvoke
Old
(Last edited by tarvoke; 12th April 2014 at 10:14 PM.) Reason: fixed broken link. thanks, brain
#1  
tarvoke's Avatar
Member - OP
Thanks Meter 23
Posts: 99
Join Date: Mar 2011
Location: Slightly Outside America
Default self-contained sideloading, adb stupid tricks version. no PC required.

(as dhayman11 pointed out, "unknown sources" is in security settings, not developer options. but no luck anyway, like most of the settings app, it also crashes if you try to set it.)

instead, here is an extremely stupid idea that just came to me.

1. turn on adb wifi debugging

2. sideload your favorite terminal, e.g.
http://jackpal.github.com/Android-Te...loads/Term.apk
(ok I lied. you will need your desktop/laptop/phone/whatever, exactly 1 time. step 2 will be skipped forever after that 1 time.)

3. fire up said terminal from the settings->applications menu.

4. (LOL!)
$ adb devices

4a. if the above command shows no devices,
$ adb connect localhost
and proceed to step 5.

4b. if the command shows exactly 1 device, e.g. "emulator-5554", proceed to step 5.

4c. if the command shows more than 1 device (wtf?!) then you will need to specify a device of your choice ("-s somedevice") in every subsequent adb command, e.g.
$ adb -s emulator-5554 <whatever>
$ adb -s localhost:5555 <whatever>
etc.

5. e.g.
$ adb install /sdcard/Download/foobar.apk
$ adb shell
$ adb uninstall -k com.something.somethingelse
etc. etc.

6. profit? profit!
KFTV: The Quest for Kindle, OUYA (kitkat!), GOGHVMU (titanium-froze 200+ apks. much better now), Qualcomm GSP 1600 (Global*Star LEO)
The Following 6 Users Say Thank You to tarvoke For This Useful Post: [ Click to Expand ]
 
tarvoke
Old
(Last edited by tarvoke; 29th May 2014 at 09:26 PM.) Reason: slightly-less-senior-moment slightly-more-coherent
#2  
tarvoke's Avatar
Member - OP
Thanks Meter 23
Posts: 99
Join Date: Mar 2011
Location: Slightly Outside America
ok here is a slightly-less incoherent form of the senior-moment-reply I posted earlier

several days ago it occurred to me to alternatively use sshd for terminal access, because:

-a) I feel a little unsafe leaving adb wifi enabled all the time (ok it's only a small thing to turn it on and off, but still) - and for security reasons there is no way to enable/disable it programmatically e.g. from a script/shell/terminal/app (well theoretically this is not exactly true, but practically it is)
-2) some people (i.e. me) would like to do shell/terminal remotely sometimes, rather than on the AFTV (and other people don't have/want a keyboard)

ssh access makes a great alternative to Term.apk, but the problem is:

- Term.apk and/or (pick your favorite android ssh server) don't have permission to run e.g. "pm install foo.apk" - it will fail. (btw 'pm' is a great command, take a look sometime at all the options. it shares a lot of functions as the adb command itself. 'am' is another fun command...)

- so, the hilarious workaround of enabling adb wifi, "adb connect", and then finally "adb shell" or "adb install" etc., is still required. (b/c the adb user is in the 'shell' group, among others - giving it permission to run /system/bin/pm) - oh well.


for random reference:
Code:
127|shell@android:/ $ id
uid=2000(shell) gid=2000(shell) groups=1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
shell@android:/ $ exit
u0_a9@android:/ $ id
uid=10009(app_9) gid=10009(app_9) groups=1015(sdcard_rw),1028,3003(inet),50009(app_40009)
(also note it appears the adb shell user might possibly have 'mount' abilities, but since the /dev/block/sd* nodes permissions' are really locked up, who knows...)
KFTV: The Quest for Kindle, OUYA (kitkat!), GOGHVMU (titanium-froze 200+ apks. much better now), Qualcomm GSP 1600 (Global*Star LEO)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes