Skip to main content
Post Closed as "Duplicate" by Andrew T.
migration clean-up
Source Link
Andrew T.
  • 16.5k
  • 10
  • 76
  • 127

I was able to run a console app (compiled with NDK) on a rooted Android phone, but can't run it on a non-rooted phone.

I tried:

adb push MyApp /mnt/sdcard/temp
adb shell
cd /mnt/sdcard/temp
chmod a+x MyApp

but chmod did not work and the file remained non-executable:

tulip:/mnt/sdcard/temp $ ls -l
total 33904
-rw-rw---- 1 root sdcard_rw 34713488 2023-10-05 19:49 MyApp

EDIT1

The files are uploaded as root, but the commands are executed as shell:

adb shell "id"                                                                                                       
uid=2000(shell) gid=2000(shell) groups=2000(shell),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid) context=u:r:shell:s0...

I was able to run a console app (compiled with NDK) on a rooted Android phone, but can't run it on a non-rooted phone.

I tried:

adb push MyApp /mnt/sdcard/temp
adb shell
cd /mnt/sdcard/temp
chmod a+x MyApp

but chmod did not work and the file remained non-executable:

tulip:/mnt/sdcard/temp $ ls -l
total 33904
-rw-rw---- 1 root sdcard_rw 34713488 2023-10-05 19:49 MyApp

EDIT1

The files are uploaded as root, but the commands are executed as shell:

adb shell "id"                                                                                                       
uid=2000(shell) gid=2000(shell) groups=2000(shell),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid) context=u:r:shell:s0...

I was able to run a console app (compiled with NDK) on a rooted Android phone, but can't run it on a non-rooted phone.

I tried:

adb push MyApp /mnt/sdcard/temp
adb shell
cd /mnt/sdcard/temp
chmod a+x MyApp

but chmod did not work and the file remained non-executable:

tulip:/mnt/sdcard/temp $ ls -l
total 33904
-rw-rw---- 1 root sdcard_rw 34713488 2023-10-05 19:49 MyApp

The files are uploaded as root, but the commands are executed as shell:

adb shell "id"                                                                                                       
uid=2000(shell) gid=2000(shell) groups=2000(shell),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid) context=u:r:shell:s0...
Post Migrated Here from serverfault.com (revisions)
Source Link
Alexey Starinsky
Alexey Starinsky

Running a console app on non-rooted Android Phone

I was able to run a console app (compiled with NDK) on a rooted Android phone, but can't run it on a non-rooted phone.

I tried:

adb push MyApp /mnt/sdcard/temp
adb shell
cd /mnt/sdcard/temp
chmod a+x MyApp

but chmod did not work and the file remained non-executable:

tulip:/mnt/sdcard/temp $ ls -l
total 33904
-rw-rw---- 1 root sdcard_rw 34713488 2023-10-05 19:49 MyApp

EDIT1

The files are uploaded as root, but the commands are executed as shell:

adb shell "id"                                                                                                       
uid=2000(shell) gid=2000(shell) groups=2000(shell),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid) context=u:r:shell:s0...