How does the shell script envsetup.sh execute launch? - android

launch 1
Segmentation fault
** Don't have a product spec for: 'full'
** Do you have the right repo manifest?
I have tried to download different sources n repo synced. I reinstalled the Linux and then carefully did the environment, all went well till I downloaded the source and then launch.
Ok left me with no other option than to look into the shell script of envsetup.sh which is throwing this error. I would like to debug from here so I run smthing like
bash --debugger build/envsetup.sh
But I don't know how to execute launch from here. As this script runs it gives the option for launch, will try setting the breakpoint at the source of the error.

We call the shell script envsetup.sh . When this script is sourced with the command
source build/envsetup.sh
I can execute all functions in this script as commands.For anyone who might wonder . Ty

Related

"Wait for Debugger" Android Studio

I am using a guide to Decompile and Debug an APK but I can not pass the last step. Where when trying to Debug APK on my phone from Android Studio, an error appears: "Wait for Debugger". According to the guide I must execute the code:
adb forward tcp:5005 jdwp:$(timeout 0.5 adb jdwp | tail -n 1)
But since I do not have Linux (I have windows), I do not know what code I should execute. Thank you very much for your help!
Guide: https://malacupa.com/2018/11/11/debug-decompiled-smali-code-in-android-studio-3.2.html
First make sure you have adb in your path.
Then open a cmd.exe and run this command:
adb jdwp
and take note where application’s debug interface is listening. I'll call this value jdwp-port from now on.
Now execute the following command:
adb forward tcp:5005 jdwp:jdwp-port
and you should be fine. REMEMBER to change jdwp-port with the value you got from the first command.
Good luck.
But since I do not have Linus (I have windows)
It is actually called Linux anyway.
As a side note, you should check the official AOSP documentation on how to use GDB here: https://source.android.com/devices/tech/debug/gdb

QPython Android Kivy, launch python script from a python script

I'm getting a permission denied error when my QPython android script tries to launch another qpython script.
I'm assuming that this can be done - right?
I've tried subprocess.call, whic seems like the right thing to do.
But, the script doesn't run, and the log shows the permission denied error.
The obvious thing to do is look at the permissions of the sub script, but I don't know how to do that on my Android phone.
Any comments/suggestion appreciated.
Thanks.
First, how to open a command prompt(bash)
Actually qpython = terminal emulator + Python code editor + Python interpreter.
So of course you can use the console! Why you can't enter bash is because every time you click the console icon in qpython it runs python. Just type something which will cause the interpreter error like "I want bash!" then run it, interpreter will break then go back to bash.
Second, how qpython run your script
It pass your python script to a shell script(qpython.sh), then run the your script by a python interpreter.
Third, about the permissions
Why permission denied? You can't run a python script directly because it's not marked as executable. But you can pass the script's path to python interpreter to run it.
Finally, so how to call a python script by a python script in qpython?
#-*-coding:utf8;-*-
#qpy:2
#qpy:console
import subprocess
print("I am calling myself!")
pysh="/data/data/org.qpython.qpy/files/bin/qpython-android5.sh"
#if U R using android 5
#else
pysh="/data/data/org.qpython.qpy/files/bin/qpython.sh"
callpy=__file__
#the script path you want to run
subprocess.call([pysh,callpy])
Hope this help you!
(I can't add image by myself because I don't have that much reputation, I need someone else to change my image link to image. So if you like my answer, please vote me. Thanks.)
Once you know where the script is, just move to that folder and then use the following command to list the files:
ls -l
the command outputs all the files together with permission (first column).
Now, to change the permission to "execution" you can use:
chmod 755 [your-script-name]

MonkeyRunner cannot run on Git Shell. Receiving #echo: command not found

I am trying to run Android's MonkeyRunner but having problems running it from my Git Shell.
When I run:
monkeyrunner.bat
it gives me this error.
$ monkeyrunner.bat
/c/AndroidSDK/tools/monkeyrunner.bat: line 1: #echo: command not found
/c/AndroidSDK/tools/monkeyrunner.bat: line 2: syntax error near unexpected token `('
/c/AndroidSDK/tools/monkeyrunner.bat: line 2: `rem Copyright (C) 2010 The Android Open Source Project'
How do I fix this? I tried running my script with it too but still same error.
Thanks in advance!
The git-shell is a login shell for SSH accounts to provide restricted Git access.
It permits execution only of server-side Git commands implementing the pull/push functionality, plus custom commands present in a subdirectory named git-shell-commands in the user’s home directory.
Therefore, if you don't have monkeyrunner (notice, not .bat or .sh here) setup in the git-shell-commands you won't be able to run it.

Executing python script in android terminal emulator

I installed python 2.7 in my Android device and I tried executing a python script by typing the command in terminal emulator. The problem is that although I use the full path for python the following error appears:
link_image[1997]: failed to link ./python CANNOT LINK EXECUTABLE.
I tried to add environment variables in ./~bashrc but I didn't make it. Any idea ?
OK it is solved. I followed these steps (http://code.google.com/p/python-for-android/wiki/RunPythonFromShell) but first I had to put the file standalone_python.sh in /data/ because in sdcard I had no permission to execute. And finally using 'su' I made it to run my script as root.

unable to run node.js on Android phone?

I have been trying to port Node.js on Android phone
by following the link below
http://www.xydo.com/toolbar/20311835-node_js_on_android
I created the node.tar on QEMU environment and sent it to the ubuntu machine ?
I have put all .so files in system/lib and node bin file in system/bin .
When i try to run it it gives "Node not Found " even though it is present .
NOTE : I have manually pushed the files since tar command does not work on android .
I am using a rooted device .
Is there any way to create the binary file in android directly without the ARM environment ???
Am i missing something ?Thanks for the help .
Thanks for the response .
I have installed debian on Android using your suggested link:
http://lanrat.com/android/debian
After that, when I run the following commands on chroot to be able to make and install Node js, (ref:http://howtonode.org/f1932c1c56d3a50fe0c21998362d80f405229b5a/arm-chroot-fun)
$git clone http://github.com/creationix/nvm.git
$. nvm/nvm.sh
$export JOBS=1
$nvm install v0.4.11
I get the following error:
/.nvm/src/node-v0.4.11/deps/v8/src/arm/macro-assembler-arm.cc:61:3: error: #error "For thumb inter-working we require an architecture which supports blx"
scons: *** [obj/release/arm/macro-assembler-arm.o] Error 1
scons: building terminated because of errors.
Waf: Leaving directory `/.nvm/src/node-v0.4.11/build'
Build failed: -> task failed (err #2):
{task: libv8.a SConstruct -> libv8.a}
Alternately, if I try the following:
$ mkdir tmp
$ cd tmp
$ wget http://nodejs.org/dist/node-v0.4.11.tar.gz
$ tar -xvzf node-v0.4.11.tar.gz
Added '-march=armv5t' to 'CCFLAGS',in node-v0.4.11/deps/v8/SConstruct and the
$ cd node-v0.4.11
$ ./configure
$ make
$ make install
the installation runs without errors, node --version reports v0.4.11 and when I try to run any node commands, I get pure virtual method called terminate called without an active exception Aborted
can you please let me know what i am doing wrong here?
You definitely have tar on your phone and everything else that comes with busybox! http://en.wikipedia.org/wiki/BusyBox Also look at this it will improve your Droid hacking time 10 fold https://github.com/jackpal/Android-Terminal-Emulator/wiki/Frequently-Asked-Questionsand consider acquiring http://www.magicandroidapps.com/wiki//index.php?title=Main_Page and https://market.android.com/details?id=org.pocketworkstation.pckeyboard Your going to wonder how you where doing it before you got these. The tutorial you where following was a little shaky so I included the resources I used to get ubuntu and nodejs running on my Android. It took me a while but it was a lot easier after a little research on how exactly debootstrap and qemu worked, you have to get a little linuxy but once its running you will be amazed at all the options you have. http://lanrat.com/android/debian http://howtonode.org/f1932c1c56d3a50fe0c21998362d80f405229b5a/arm-chroot-fun What I ended up doing was building a cross compilation tool kit using deb boot strap and qemu and compiling everything on my desktop then moving the image over to my Android. Lastly I included my arm ubuntu Image. You may have to tweak the bash script a bit but other then that the image is universal and even runs on an IPhone. If you have any trouble digesting all this or getting the image working feel free to ask. I want to see node on as many phones as possible! www.castedspell.com/ubuntu4droid.tar.gz The image is 3 gigs uncompressed but really only 600 mb and you can use any partition re-size tool to shrink it down.
There is an Android port of NodeJS with source you can get up and running with.

Categories

Resources