Enable adb and usb debug in TWRP 4K - Fire TV Q&A, Help & Troubleshooting

Question.
Is it possible to enable adb and usb debug in twrp.
Currently i try to Bypass initial Setup .
It works with customized com.amazon.tv.oobe.apk
For pairing CEC is needed ,but it is not possible to enable debug and adb. ( no Option in settings ).

0815hoffi said:
Question.
Is it possible to enable adb and usb debug in twrp.
Currently i try to Bypass initial Setup .
It works with customized com.amazon.tv.oobe.apk
For pairing CEC is needed ,but it is not possible to enable debug and adb. ( no Option in settings ).
Click to expand...
Click to collapse
You can connect your Fire stick to your PC and follow these link:
https://gist.github.com/varhub/7b9555cdd1e5ad785ffde2300fcfd0bd

0815hoffi said:
Question.
Is it possible to enable adb and usb debug in twrp.
Currently i try to Bypass initial Setup .
It works with customized com.amazon.tv.oobe.apk
For pairing CEC is needed ,but it is not possible to enable debug and adb. ( no Option in settings ).
Click to expand...
Click to collapse
I did this and it worked..
1) In Windows grab this file:
C:\Users\XXXUSERNAMEXXX\.android\adbkey.pub
and change filename to adb_keys
Put this on a USB stick that will be accesible form TWRP (You'll need a hub for both mouse and USB stick)
2) In terminal in TWRP type:
echo -n 'mtp,adb' > /data/property/persist.sys.usb.config
echo '' >> /system/build.prop
echo '# Enable ADB' >> /system/build.prop
echo 'persist.service.adb.enable=1' >> /system/build.prop
echo 'persist.service.debuggable=1' >> /system/build.prop
echo 'persist.sys.usb.config=mtp,adb' >> /system/build.prop
3) In File manager in TWRP
Make sure that the drives are properly mounted in the Mount option (I think it's system)
Copy adb_keys from USB stick to Firestick4Kt to this location
/data/misc/adb/
4) Reboot Firestick4K and connect to from windows

tinybilbo said:
I did this and it worked..
1) In Windows grab this file:
C:\Users\XXXUSERNAMEXXX\.android\adbkey.pub
and change filename to adb_keys
Put this on a USB stick that will be accesible form TWRP (You'll need a hub for both mouse and USB stick)
2) In terminal in TWRP type:
echo -n 'mtp,adb' > /data/property/persist.sys.usb.config
echo '' >> /system/build.prop
echo '# Enable ADB' >> /system/build.prop
echo 'persist.service.adb.enable=1' >> /system/build.prop
echo 'persist.service.debuggable=1' >> /system/build.prop
echo 'persist.sys.usb.config=mtp,adb' >> /system/build.prop
3) In File manager in TWRP
Make sure that the drives are properly mounted in the Mount option (I think it's system)
Copy adb_keys from USB stick to Firestick4Kt to this location
/data/misc/adb/
4) Reboot Firestick4K and connect to from windows
Click to expand...
Click to collapse
Thanks for the Help.
Got it working.

Related

[WIP] [FIX] Enable Built-in Tethering in UCLD2 ICS ROMS

Been working on a couple fix ideas for this since UltraCfg is no longer working in the UCLD2 leak.
From what I can tell, UltraCfg made an entry in settings.db which can be enabled or disabled. This entry is TETHERING_ALWAYS_ON_MODE = enabled/disabled. Steps to manually do this are shown in post #2.
Also: Tethering Manager & UltraCfg were active; and WifiDirect, Wifi Sharing, and Wifi Sharing Manager are frozen.
Please let me know if any of this works and we can continue to improve this. I'm not sure how stable it is.
Known Issues & Limitations:
1. Only tested by me so far.
2. Not sure if it stable yet. I've had issues keeping wifi tethering active.
3. Any time you connect phone to PC via USB, it disables Debugging and activates Tethering.
4. USB Debugging is disabled on reboot.
5. Not an easy patch for the novice.
I used sqllite editor which is $2.99 in the market. If you dont want to pay and you can survive some terminal shell grinding, here's a free method using sqlite3. For whatever reason, it's not installed by default in our ROMs.
1. Download sqlite3.zip attached. Unzip and put it in /system/bin.
-- quickest method is to unzip. then use adb.
Code:
adb mount
adb push sqlite3 /system/bin
adb chmod 771 /system/bin/sqlite3
2. Next we are going to make a copy of our settings.db file as settings.dbx. Again, in adb.
Code:
adb shell
>su
>cd /data/data/com.android.providers.settings/databases
>cp settings.db settings.dbx
3. Dont close your terminal. Now that we have a copy, we will now edit it with sqlite3. Assuming you did a clean data wipe when you first installed the UCLD2 rom do this:
Code:
echo "insert into system (name, value) values('TETHER_ALWAYS_ON_MODE','enabled');"|sqlite3 settings.dbx
4. Now we have inserted the new tethering setting! Now we need to backup your original settings and replace it with this modified one.
Code:
mv settings.db settings.bak
mv settings.dbx settings.db
5. DONE! Now you may need to reboot.
Code:
reboot
Now, I'm not 100% sure this will work, but I never wiped my data from the UCAL4 ROMs to this new one, so my settings never changed. You will also need Tethering Manager. The one issue with having this mode on is that you will get automatically switched to usb tethering when you connect your phone to computer.
If you ever want to disable, follow steps above except use this command in step 3:
Code:
echo "update system set value = 'disabled' where name = 'TETHERING_ALWAYS_ON_MODE';"|sqlite3 /settings.dbx
I followed the steps ending in a boot loop

Loop Boot after installing chainfire3d

my GT-N5100 got stock in loop boot after I install the driver of chainfire3d..
i tried to restore it factory default..erasing cache...but nothing seems to work...
I already resolved it using adb
This is How I fixed mine..
I search several forum and and no one has the complete tutorial on how to use adb..
so I created my own step by step tutorial on how I did it just in case I need it again or someone needs it...
I hope this fixed yours as well..
Download ADB here: http://developer.android.com/tools/help/adb.html
1. extract the file you just download
2. put it in C: (so you can access it easily)
3. you can rename it (you can name it anything you want but we will use "Android-adb" in this tutorial)
4. open SDK Manager.exe
5. make sure that Android SDK tools, Android SDK Platform-tools, Android SDK Build-tools and Google USB Driver is installed
6. Boot your device to recovery mode (hold volume up + power) hold it until it is turned on
7. connect your device through usb to PC (it should automatically install your usb driver if not download samsung usb driver)
8. go to CMD
9.type cd c:\Android-adb\sdk\platform-tools
or
9.1 press windows + pause/break
9.2 click Advance tab
9.3 click Environment Variables
9.4 search "path" under System variable
9.5 click edit (there is a value for Variable value in default)
9.6 at the end of the default value add this ;C:\Android-adb\sdk\platform-tools
9.7 click ok
10.
type this
adb
adb shell
[email protected]:/ $ su
adb shell /system/lib/cf3d_uninstall.sh
11. your device will reboot...after that it should be fine...
NOTE:
if you encounter device not detected or something try this..
adb kill-server
adb start-server
>.<
Please read before installing anything.
Chain fire works for gingerbread. .. DOESN'T WORK with ice cream sandwich and jelly bean
Sent from my GT-N5100 using Tapatalk 2
actualy I didn,t download it from from google play...
that **** bastard site didn't include that warning...
sorry chainfire for not buying it from google play maybe thats my karma..haha..
but my gt-N5100 is fine now..I google for a solution and I found 1..
Edit: if chainfire manage to make it compatible with JB, I'll promise to pay for it next tym.. I wanted to play some THD...
Sent from my GT-N5100 using XDA Premium HD app
jhonuy03 said:
actualy I didn,t download it from from google play...
that **** bastard site didn't include that warning...
sorry chainfire for not buying it from google play maybe thats my karma..haha..
but my gt-N5100 is fine now..I google for a solution and I found 1..
Edit: if chainfire manage to make it compatible with JB, I'll promise to pay for it next tym.. I wanted to play some THD...
Sent from my GT-N5100 using XDA Premium HD app
Click to expand...
Click to collapse
Where did you read or see its compatible with JB
Sent from my Galaxy Nexus using XDA Premium HD app
Same issue stuck at boot logo
Could you please let me know how to solve this issue using adb
I am having same issue :crying:
Thanks in advancex
FIXED
ankitwase said:
Could you please let me know how to solve this issue using adb
I am having same issue :crying:
Thanks in advancex
Click to expand...
Click to collapse
This is How I fixed mine..
I search several forum and and no one has the complete tutorial on how to use adb..
so I created my own step by step tutorial on how I did it just in case I need it again or someone needs it...
I hope this fixed yours as well..
Download ADB here: http://developer.android.com/tools/help/adb.html
1. extract the file you just download
2. put it in C: (so you can access it easily)
3. you can rename it (you can name it anything you want but we will use "Android-adb" in this tutorial)
4. open SDK Manager.exe
5. make sure that Android SDK tools, Android SDK Platform-tools, Android SDK Build-tools and Google USB Driver is installed
6. Boot your device to recovery mode (hold volume up + power) hold it until it is turned on
7. connect your device through usb to PC (it should automatically install your usb driver if not download samsung usb driver)
8. go to CMD
9.type cd c:\Android-adb\sdk\platform-tools
or
9.1 press windows + pause/break
9.2 click Advance tab
9.3 click Environment Variables
9.4 search "path" under System variable
9.5 click edit (there is a value for Variable value in default)
9.6 at the end of the default value add this ;C:\Android-adb\sdk\platform-tools
9.7 click ok
10.
type this
adb
adb shell
[email protected]:/ $ su
adb shell /system/lib/cf3d_uninstall.sh
11. your device will reboot...after that it should be fine...
Help
jhonuy03 said:
This is How I fixed mine..
I search several forum and and no one has the complete tutorial on how to use adb..
so I created my own step by step tutorial on how I did it just in case I need it again or someone needs it...
I hope this fixed yours as well..
Download ADB here:
1. extract the file you just download
2. put it in C: (so you can access it easily)
3. you can rename it (you can name it anything you want but we will use "Android-adb" in this tutorial)
4. open SDK Manager.exe
5. make sure that Android SDK tools, Android SDK Platform-tools, Android SDK Build-tools and Google USB Driver is installed
6. Boot your device to recovery mode (hold volume up + power) hold it until it is turned on
7. connect your device through usb to PC (it should automatically install your usb driver if not download samsung usb driver)
8. go to CMD
9.type cd c:\Android-adb\sdk\platform-tools
or
9.1 press windows + pause/break
9.2 click Advance tab
9.3 click Environment Variables
9.4 search "path" under System variable
9.5 click edit (there is a value for Variable value in default)
9.6 at the end of the default value add this ;C:\Android-adb\sdk\platform-tools
9.7 click ok
10.
type this
adb
adb shell
[email protected]:/ $ su
adb shell /system/lib/cf3d_uninstall.sh
11. your device will reboot...after that it should be fine...
Click to expand...
Click to collapse
I tried the above at last it is showing device not found
wew
ankitwase said:
I tried the above at last it is showing device not found
Click to expand...
Click to collapse
that's how exactly how I did it...
at least that what I remembered I did..
and it works for me..
is your device rooted?
Help
jhonuy03 said:
that's how exactly how I did it...
at least that what I remembered I did..
and it works for me..
is your device rooted?
Click to expand...
Click to collapse
Yes i think it is rooted
Do i need to do wipe data in recovery mode ?
I think so because I wipe my cache and reset to factory default before I used ADB...
Sent from my GT-N5100 using Tapatalk HD
just ignore step 9.1 to 9.7...
Sent from my GT-N5100 using Tapatalk HD
jhonuy03 said:
I think so because I wipe my cache and reset to factory default before I used ADB...
Sent from my GT-N5100 using Tapatalk HD
Click to expand...
Click to collapse
Tried after wiping cache getting some problem "device not found"
Drivers are also installed correctly
r u sure u r in recovery mode and device is attach to usb?
Sent from my GT-N5100 using Tapatalk HD
Help
jhonuy03 said:
r u sure u r in recovery mode and device is attach to usb?
Sent from my GT-N5100 using Tapatalk HD
Click to expand...
Click to collapse
Yes i m in recovery mode, and when i am typing adb devices it is showing a serial number, i checked and found if device is connected
and if i issue adb devices then it will show serial number if device is connected
did you install google usb driver in sdk manager?
Sent from my GT-N5100 using Tapatalk HD
adb
When you type adb this should be the output
Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.
C:\Windows\system32>adb
Android Debug Bridge version 1.0.31
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <specific device> - directs command to the device or emulator with
the given
serial number or qualifier. Overrides ANDROID_S
ERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices [-l] - list all connected devices
('-l' will also list device qualifiers)
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --
iv <hex-encoded iv>] <file>
- push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
('--algo', '--key', and '--iv' mean the file is
encrypted already)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosy
stem] [<packages...>]
- write an archive of the device's data to <file>
.
If no -f option is supplied then the data is wr
itten
to "backup.ab" in the current directory.
(-apk|-noapk enable/disable backup of the .apks
themselves
in the archive; the default is noapk.)
(-shared|-noshared enable/disable backup of the
device's
shared storage / SD card contents; the defau
lt is noshared.)
(-all means to back up all installed applicatio
ns)
(-system|-nosystem toggles whether -all automat
ically includes
system applications; the default is to inclu
de system apps)
(<packages...> is the list of applications to b
e backed up. If
the -all or -shared flags are passed, then t
he package
list is optional. Applications explicitly g
iven on the
command line will be included even if -nosys
tem would
ordinarily cause them to be omitted.)
adb restore <file> - restore device contents from the <file> backup
archive
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb get-devpath - prints: <device-path>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
C:\Windows\system32>
Help
jhonuy03 said:
did you install google usb driver in sdk manager?
Sent from my GT-N5100 using Tapatalk HD
Click to expand...
Click to collapse
Yes i have installed it
please see the attachment
oh wa8 i remembered something...
try to type in cmd
adb stop-server
adb start-server
Sent from my GT-N5100 using Tapatalk HD
Help
jhonuy03 said:
oh wa8 i remembered something...
try to type in cmd
adb stop-server
adb start-server
Sent from my GT-N5100 using Tapatalk HD
Click to expand...
Click to collapse
C:\Windows\system32>adb
'adb' is not recognized as an inte
operable program or batch file.

[GUIDE] How To Get AFTV Kodi NFS file sharing working with OSX

How To Get NFS Sharing working with AFTV Kodi on OSX
Part 1)
OSX>Open Terminal
type in Terminal "sudo nano /System/Library/LaunchDaemons/com.apple.nfsd.plist"
Scroll Down and find "<string>/sbin/nfsd</string>" now move cursor to end of line and press return
This will insert a new line, press tab
type "<string>-N</string>"
press ctrl + o, press enter , press ctrl + x.
Part 2)
Download NFS Manager 3.9 from here.
Install App
Start app,
Configure Shares:
1. Select NFS Server > Share Definitions
2. Click plus + to add a share in Shared Folders window
3. Click "Select" below the + - and add your Folder you want to Share
4. Options - tick only this >> 'Allow clients to also mount objects in the shared folder"
5. User Mapping > Don't map users
6. Minimum Security > System standard only
7. Access Permission > Allow access from any network computer
8. Click "Apply" and you done.
9. NFS manager can now be Quit and OSX will still continue to share files and folders even after rebooting
Part 3)
Open Terminal
type or paste "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.nfsd.plist"
type or paste"sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.nfsd.plist"
OSX > System Preferences > File Sharing > Options > Untick - Share Files and Folders using SMB > Done
OSX > System Preferences > File Sharing > Options > Tick - Share Files and Folders using SMB >
Under Windows File Sharing Select On next to the account> Done
Open Terminal
if using Yosemite
type or copy "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist"
type or copy"sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist"
if using Mavericks:
type or copy "sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist"
type or copy "sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist"
Now NFS Shares Should work with KODI
Part 4
Open KODI on AFTV
1) Select System>System>Power Saving>Try to wake remote servers on access On
2)Go Back to Main Menu Select System>File Manager
3)Add Source>Select None> Now Type "nfs://your OSX iport Number/" example "nfs://192.168.1.64:2049/"
(You can get the OSX IP from OSX > System Preferences > File Sharing)
(You can get the Port No From OSX> terminal type "rpcinfo -p | grep nfs" this will bring up "udp (port number) nfs" example "100003 3 udp 2049 nfs")

OnePlus Nord | N10 | N100 [TMO/MPCS] Network Unlock & Enable OEM Unlocking (April 19th, 2021)

1.) ADB access must be enabled
-Tap build number 7 times until Developer Options are enabled
2.) Enable USB Debugging
-For PC-less enable Wireless Debugging
Optional if PC-less
3.) Go to Play Store or F-Droid and download Shizuku
4.) Tap Shizuku in Terminal Apps and configure the shizuku file reflect the terminal package is "com.termux" and Start Shizuku
5.) Navigate to where the shizuku and shizuku.dex files are andn enter
cat shizuku > $PREFIX/bin/shizuku && chmod 755 $PREFIX/bin/shizuku
cat shizuku.dex > $PREFIX/bin/shizuku.dex && chmod 755 $PREFIX/bin/shizuku.dex && shizuku sh
TADA Now you have an ADB Shell locally on your OnePlus. One last command to enter.
settings put secure device_provisioned 0
Either nothing is returned or one word 'Success'is the only way to confirm the command was executed properly.
If with computer :
adb shell settings put secure device_provisioned 0
Congratulations your phone is now Network Unlocked. But wait, there's more to this groundbreaking method.
To enable OEM Unlocking in the Developers Menu this is where things get chipote-cray
In your terminal (termux, bash) enter this command
MOD EDIT: Link removed
Enter accordingly to onscreen prompts and then exit the script.
For finalization of effects Enter
adb reboot-bootloader
Toggle for the Start option.
Go to Network and Sim and there is confirmation that the Network Unlock is persistent. Go to Developer Options and viola, the Enable OEM Unlock button is enabled again. This is also persistent. Make sure to leave enabled in case of accidental/intentional factory reset. Good job everyone.
To get unlock code for the OnePlus.com/unlock_token form Enter
adb reboot-bootloader && fastboot oem get_unlock_code
0day from Jay . This isn't cosmetic, this directly impact's the kernel and is thus persistent.
Support for this is located
MOD EDIT: Link removed

ADB debugging not working on reboot

I am running lineageOS on a rooted firestick. I am using ADB on the Firestick to control it via Homeassistant. The problem is that the adb debugging does not automatically work on reboot. Everytime i reboot i have to manually go to the menu turn off the ADB debugging and then turn in back on. After doing this i am able to reconnect adb via network (i.e, on homeassistant).
I want to ask is there any way i can use a script to automatically do this on restart of firestick. I have tried creating a script in init.d with the following contents but it doesn't seem to work.
adb tcpip 5555
I have added the following line to build.prop but this doesn't seem to work too
service.adb.tcp.port=5555
On restart the adb debugging is on in the developer tools but somehow it doesn't connect (either to Homeassistant or to my laptop), what seems to make it work is toggling it off and then back on.
Have you tried persist, so that the setting sticks between reboots?
Code:
ADB shell setprop persist.adb.tcp.port 5555
Just tried it. Still not working after reboot.
I there any command i can use to toggle the adb debugging via a startup script or crontab?
symbiansucks said:
Just tried it. Still not working after reboot.
I there any command i can use to toggle the adb debugging via a startup script or crontab?
Click to expand...
Click to collapse
Be sure you are running the above command as root user. Type su at the shell prompt, then type whoami to confirm you are root.
I guess you could make a script to run the following on each boot if the above doesn't work:
Code:
settings put global adb_enabled 1
setprop service.adb.tcp.port 5555
stop adbd
start adbd
exit 0
But I don't think this should be necessary.
Finnzz said:
Be sure you are running the above command as root user. Type su at the shell prompt, then type whoami to confirm you are root.
I guess you could make a script to run the following on each boot if the above doesn't work:
Code:
settings put global adb_enabled 1
setprop service.adb.tcp.port 5555
stop adbd
start adbd
exit 0
But I don't think this should be necessary.
Click to expand...
Click to collapse
Thanks. yes the command was run as root. Can i ask you one more thing, whats the best place to put the startup scripts in? I have tried init.d/ directory but the scripts don't get loaded from there i believe?
I have set permissions to chmod 755 for the script.
You can follow this guide,
Android (LineageOS 16) Execute Script on Start Up | sqall's blog
but it seems like there should be a much easier way to make ADB tcpip persist between reboots. I don't want to steer you wrong. @Sus_i would know better, he uses your build of LineageOS, and may have a cleaner solution.

Categories

Resources