Re: run a binary c++ on android

128 views
Skip to first unread message
Message has been deleted

enh

unread,
Apr 26, 2024, 11:03:30 AMApr 26
to andro...@googlegroups.com
what do `ls -l ./hi` and `file ./hi` say?

On Fri, Apr 26, 2024 at 8:02 AM ines baklouti <baklout...@gmail.com> wrote:
>
> i tried to run binary c++ from my pc linux into android device
> i did those steps :
> # adb push /home/hi /sdcard
> 1 file pushed.
> sudo adb shell chmod 777 hi
> sudo adb shell chmod +x hi
> Q:/sdcard $ ./hi
> /system/bin/sh: ./hi : can't execute: Permission denied
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/09087377-a113-4a71-8b15-b6c6d392dd20n%40googlegroups.com.

Florian Mayer

unread,
Apr 26, 2024, 12:23:17 PMApr 26
to andro...@googlegroups.com
Why are you running `sudo adb shell [...]`? I would guess you want `adb shell su root [...]`.

jeff shanab

unread,
Apr 26, 2024, 3:22:37 PMApr 26
to andro...@googlegroups.com
is it saying you cannot run bash? or is it saying bash cannot run hi

John Dallman

unread,
Apr 30, 2024, 6:25:58 AMApr 30
to andro...@googlegroups.com
Here's a more practical version; L$ is the Linux shell prompt, A$ is the Android shell prompt.

L$ adb push /home/hi /data/local/tmp                    # /data/local/tmp is a directory on device internal storage, where the  
                                                                             # execute bit in file permissions survives pushing to the device.
L$ adb shell
A$ cd /data/local/tmp
A$ ls -l hi
A$ ./hi

John


  

James Farrell

unread,
Apr 30, 2024, 12:10:09 PMApr 30
to andro...@googlegroups.com
Is /home/hi an Android binary? What does it say when you run "file /home/hi"?

-- James


Clark Kent

unread,
May 9, 2024, 3:06:26 AMMay 9
to andro...@googlegroups.com
this includes /sdcard and other mount links to internal/external storage

On Thu, 9 May 2024, 5:04 pm Clark Kent, <smallvi...@gmail.com> wrote:
User home directories have EXEC permission DISABLED for /storage/emulated/0 and /storage/<sd_card_id>

Only /data/local/tmp has exec permissions

Reply all
Reply to author
Forward
0 new messages