Enabled UMS and MTP command line. - AT&T Samsung Galaxy Note II

I know I can use SGS3 Easy UMS but
Can someone tell me what the commands are to do these same actions from command prompt. This is on a Samsung Note 2 At&t.
1. Enabled UMS mode
2. Enabled MTP mode
3. Mount SD Card.
I am trying to write a tasker task that will kill all applications running and then run UMS mode. My car stereo is picky about what is running i guess. I always have to run advanced task killer to kill all apps and then run UMS mode. This allows my mp3 to play just fine.
I have tried the following commands
setprop persist.sys.usb.config mass_storage,adb
setprop persist.sys.usb.config mtp,adb
neither of those have worked

Related

[Q] Switching between USB and Mass storage modes

Back in the days of my SGS1, we could switch between MTP and mass storage mode using the following commands in a terminal emulator session :
To enable MTP : setprop persist.sys.usb.config mtp
To enable mass storage : setprop persist.sys.usb.config mass_storage,adb
Will these commands still work on a rooted SGS3 ?
Current config :
Phone model : i474m
Carrier : Bell
ROM : Stock LH1 + root
CWM : not yet installed (no Nandroid... hence why I'm not willing to try for myself at the moment)
no one?

MTP problem

I have problems with connecting my mobile phone with other devices after introducing MTP connection - when I am pluging t989 into tv, there is a info about problems with recognizing the device, the same prompt is on other devices such like Satelite receiver, etc. Earlier when I had usb storage connection I didnt have such problems. Can sb help me with that ?
sony11 said:
I have problems with connecting my mobile phone with other devices after introducing MTP connection - when I am pluging t989 into tv, there is a info about problems with recognizing the device, the same prompt is on other devices such like Satelite receiver, etc. Earlier when I had usb storage connection I didnt have such problems. Can sb help me with that ?
Click to expand...
Click to collapse
This is possible to fix with some ROM/Kernel pairs, but not all.
you need to run a series of commands to prepare things for "mass storage" mode, and then run a different set of commands before removing it to prevent data corruption and data mismatch. I have found that if you add files while in this "pretend mass storage" mode, you sometimes need to reboot for them to sync up properly.
all of the commands need to be run as root.
first you need to put your phone into mass storage mode by running:
setprop sys.usb.config mass_storage
if you need adb access, run the command as:
setprop sys.usb.config mass_storage,adb
then you need to tell the system where to "look" for the mass storage devices. I will include the optional steps too (mounting the sd cards in RO mode to prevent both systems writing to the card at once which will likely cause corruption):
mount -o remount,ro /storage/sdcard0
mount -o remount,ro /storage/sdcard1
echo /dev/block/vold/179:97 > /sys/class/androd_usb/android0/f_mass_storage/lun/file
echo /dev/block/vold/179:28 > /sys/class/android_usb/android0/f_mass_storage/lun_ex/file
when you are done with your mass storage stuff, you will need to run the following to remove these shares:
echo "" > /sys/class/androd_usb/android0/f_mass_storage/lun/file
echo "" > /sys/class/android_usb/android0/f_mass_storage/lun_ex/file
mount -o remount,rw /storage/sdcard0
mount -o remount,rw /storage/sdcard1
I have not (yet) tested this on a KK ROM, but it works nicely on hellybean with Diablo or Uber kernels. Technically, I suppose you wouldn't need to run the remounts, but I recommend it as you don't want a corrupted filesystem. And technically I guess you don't need to blank out the "file" afterwards, but I do as I don't want android thinking I'm still connected when I'm not.
I personally don't like MTP as it doesn't play as nice with other older devices as mass_storage, but mass_storage doesn't allow both the android phone and windows/mac/linux/etc to preform RW operations at the same time without a high risk of data corruption.

How to enable USB debugging on a broken screen using ADB (Permission & Root Issue)

How to enable USB debugging on a broken screen using ADB (Permission & Root Issue)
I have a Samsung Note 2 with a Broken screen/digitizer. So no haptic feedback's. Anyway the USB Debugging is already on and I could use the Remote tools like SideSync, Mobizen & other software's on my old machine before the screen broke. But now with new laptop I need to re-enable usb debugging or accept the fingerprint thing that pops up but I can't see what's on my screen. Also I don't know how to force this.
I've tried following several guides on how to enable through build.prop and adding lines - http://forum.xda-developers.com/showthread.php?t=2652564
but when trying to push the file back -
Code:
failed to copy c:\android\build.prop /system/build.prop : permission denied.
I've tried
Code:
adb remount
&
Code:
adb shell
su
mount -o remount, rw /system
and for both I get remount failed : operation not permitted.
I've tried using
Code:
adb usb & adb root
adb root shows error -- adbd cannot run as root in production builds.
adb usb - is just stuck nothing happens.
I've tried googling the above errors but any solutions don't seem to be working.
Reason why I use this phone is because I have kodi installed and everything was working up until now. I had wifi on the device - Do you think I could just enable or rename my wifi name to the same one? Problem would be what password I used. I still have my old router.
Any advice?
Thanks
I believe the devices isn't rooted. I tried using ADB Shell and typed in captials SU but got not found however typing it in lowercase nothing happens. just goes to the next line

[GUIDE] Access color-filter through command shell

I'm running on the 10.5.10.IN11BA build.
Just get a command shell to your OnePlus 8 Pro through adb, no need for the device to be rooted or anything.
Once you get there, just type:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
It will launch the FactoryMode app and get you directly to the manual camera test view.
Just press the bottom right icon until you get to the color filter.
I have no doubt there is easier and quicker ways to get the same result, maybe through an apk.
Edit:
As far as I know, this workaround could work on any OnePlus 8 Pro model.
Also, as pointed out by ster88, you also can take videos with the filter, which was not possible with the camera app.
I tried not working. I used th terminal app from google playstore.
Can u specifically provide which app and where.
And anything to enable on developer mode.
sajjadhussaini said:
I tried not working. I used th terminal app from google playstore.
Can u specifically provide which app and where.
And anything to enable on developer mode.
Click to expand...
Click to collapse
Sure !
To enable developper mode, go to "Settings > About phone" and tap the "Build number" until they tell you have developper mode enabled.
Then go to "Settings > System > Developper options" and under "Debugging" enable "USB Debugging" and "Wireless ADB Debugging".
Once that is done, on your computer, download the platform-tools, containing adb here :
Code:
https://developer.android.com/studio/releases/platform-tools
Once it is downloaded, go inside it with your command line.
If you are doing this wirelessly, get your phone IP address and type:
Code:
adb connect <your-phone-ip-address>
Then if it worked, to know what the transport id of our device is, type :
Code:
adb devices -l
Once you have the transport id, type this to get a shell to your phone:
Code:
adb -t <transport-id> shell
You can get more details on how adb works here:
Code:
https://developer.android.com/studio/command-line/adb
Then when you have access to the shell, just type:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
If everything went fine, you should get access to the camera !
I could not use a terminal app to run the command, usually because the terminal app doesn't want to let the camera application to take over the view, or something like that, not sure.
The ideal would be to have a dedicated apk to run the command, at least for the time being.
Tried to launch using an app called Activity launcher and it didn't work.
play.google.com/store/apps/details?id=de.szalkowski.activitylauncher
imgur.com/a/BS9Wqzc
I'm not rooted, are you sure this works for non rooted devices? I'll try later with adb to see what happens.
Here is the error from Termux. Hope it can be loaded via apk, not sure if it suffers same restrictions:
$ am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Warning: Activity not started because the current activity is being kept for the user.
From what I understood, you need to run the command from an adb shell. You cannot run it from within the phone as far as I know.
You can still run it from adb and "lock" the application so it stays in the background.
And I tried with multiple Terminal apps, the command works with none of them (Termux, Terminal Emulator, Material Terminal, etc...)
Apparently, you have some rights on the adb command shell that you don't get as a simple user on the phone.
You man are genius. I found easy way also to keep it running if needed. After getting the camera test to run, you can lock the app so phone will not close it and always return to it. Thanks, finally I can enjoy my camera
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
lllsondowlll said:
Here is the error from Termux. Hope it can be loaded via apk, not sure if it suffers same restrictions:
$ am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Warning: Activity not started because the current activity is being kept for the user.
Click to expand...
Click to collapse
Did you get any solution for this ?
aishkumar said:
Did you get any solution for this ?
Click to expand...
Click to collapse
...
lllsondowlll said:
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Click to expand...
Click to collapse
I've made a script that allows you to launch the Camera from your phone by just typing ./camera in Termux. No root needed. It can be found here: https://github.com/lllsondowlll/OP8_Camera/blob/master/README.md
can u make a video on this how u used termux and what to do whole process screen recording will be helpful coz i am new to this and i dnt wanna mess up with my phone if i lost some files or smthing please make a video i really want to play with IR camera
It works but not really required
It's working, but have few questions to myself.
1. Does it really needed?
Ans: No, you won't keep clicking pics of plastic material to see inside.
2. Is it handy?
Ans: yes, once opened you can pin/lock it in recent app and open whenever required.
It is just a IR camera and nothing wrong in it, I believe OP will enable it in future, because it really doesn't show through the clothes and even if you want to see for some black thin clothes, you need to go near.
So if you are thinking to click the nude people and go closure you will be slapped.
Few images I have taken.
babsvsphudi said:
can u make a video on this how u used termux and what to do whole process screen recording will be helpful coz i am new to this and i dnt wanna mess up with my phone if i lost some files or smthing please make a video i really want to play with IR camera
Click to expand...
Click to collapse
https://youtu.be/iVQYu-CeN24
You can't hurt anything. Just follow the instructions.
lllsondowlll said:
You can't hurt anything. Just follow the instructions.
Click to expand...
Click to collapse
thanks man you are awesome love n respect for u brother
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Error type 3
Error: Activity class {com.oneplus.factorymode/com.oneplus.factorymode.camera.manualtest.CameraManualTest} does not exist.
connected to localhost:5555
error: more than one device/emulator
I ran it as the video shows. But I got an error like above.
Is there any way to solve this problem or is it not possible with IN2020? Please forgive me for using a translator.
pcningen said:
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Error type 3
Error: Activity class {com.oneplus.factorymode/com.oneplus.factorymode.camera.manualtest.CameraManualTest} does not exist.
connected to localhost:5555
error: more than one device/emulator
I ran it as the video shows. But I got an error like above.
Is there any way to solve this problem or is it not possible with IN2020? Please forgive me for using a translator.
Click to expand...
Click to collapse
I was able to resolve this issue by reinstalling factory mode. I apologize to you for a fuss over. Many thanks to the developers of this method.
Since I can't get termux to work for now, another idea if you want to have it accessible all the time(*), is to run this (beautiful) command with an adb shell from a computer and then lock the app so you can't accidentally close it.
After that you can always go back to it whenever you want it!
*App won't remain locked after reboot, obviously.
lllsondowlll said:
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Click to expand...
Click to collapse
I wanna piggyback on this some, since this is similar to the process I just did.
So while this works for nonroot users (I didn't actually test the nonroot version myself), if you are rooted, AND using magisk, I personally install ADB and fastboot binaries from the repo from zackptg5(?) And then just told termux to run an elevated shell (su) and then pasted in the command linked in OP:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
It then loaded the testmode camera app, and (xXx caused it to crash, I had to disable it but I don't know if it's a setting with my config) voila. It worked! Thank you.
Edit: I wanna say just running termux in root would solve the issue either way still, but, my point still is there.

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