I'm developing simple project using Chromium for android is there some way to debug Chromium C++ code through eclipse debugger?
Right now i have possibility to debug C++ through Terminal using GDB or DDD.
In case how to use DDD here is short instruction:
1.Install ddd application
sudo apt-get install ddd
2.Change adb_gdb file in directory chromium/src/build/android
change the line $GDB $GDBARGS -x $COMMANDS && to
ddd --debugger $GDB $GDBARGS -x $COMMANDS &&
cd /chromium/src
. build/android/envsetup.sh
build/android/adb_install_apk.py --apk ContentShell.apk
build/android/adb_run_content_shell
build/android/adb_gdb_content_shell
DDD application (example, how to use)
a. File->Open Source -> Filter -> set filename "ipc_chnnel_proxy.cc" -> Open
b. set breakpoints in the function ChannelProxy::Context::OnMessageReceived
c. run the command Cont
d. DDD will break on this breakpoint
See https://code.google.com/p/chromium/wiki/LinuxEclipseDev in particular the "Optional: Building inside Eclipse" section. It's still a bit flaky but works most of the time.
I got a working solution to debug Chromium for Android from Eclipse. It involves the creation of some wrappers following the idea you propose in your step 2. Your proposal lacks a way of telling Eclipse to use that debugging scripts, but it can be done by properly tweaking the debug configuration in Eclipse to use the gdb/mi debugger and open the proper wrappers.
All the steps are explained in this post: http://blogs.igalia.com/eocanha/2014/10/14/hacking-on-chromium-for-android-from-eclipse-part-2
Related
I'd like to know if some of you worked out how to generate signed APKs and IPA with multiple configurations (ie : beta for hockeyapp, and production for stores) in a single command.
I'm exploring all the possibilities there, it looks like there are lots of ways to do this.
I'd also like to be able to pass a variable like ENVIRONMENT to set Javascript constants such as an API url or turn on/off debugs.
Here's what I'm thinking right now :
Using https://www.npmjs.com/package/react-native-config to solve the former problem.
On android :
I'm thinking about adding a type in buildTypes in gradle. So far, I couldn't get it to work, I'm not very experienced with native configurations.
I would then make a bash script to create the offline bundle with the chosen env (staging / dev / prod) and use gradle's assembleRelease / assembleBeta. Do you think that's doable ?
On iOS, it looks a bit more complicated :
It looks like it's hard to change the project's configuration in CLI when building. So I was thinking that I should duplicate the project for each environement : project-dev.xcodeproj, project-prod.xcodeproj... you got the point.
Once again, I would make the bundle, then cp it inside the given project. A nice touch would be to trigger the xcode compilation in CLI too, I don't know if this is hard to set up.
What do you think about this ? Maybe some of you are already using custom scripts to do that ?
The icing on the cake would be to use HockeyApp's 'puck' cli tool to upload it, but that should be quite easy to set up once the application has been build for both iOS and Android.
This is the process I use for command line build with parameters. My system builds a release version .ips file and then copies and resigns that file with a development provisioning profile that I can put on my development devices to test exactly what is being sent to the customer or to the app store. Not all of this will be useful to you, but hopefully some will.
First, I have a variables file that sets the global parameters that I'm going to use for the build:
Scheme="(The scheme I am going to build inside my project)"
WindowsSavePath="(path to my source archive directory on a shared computer)"
InstallSavePath="(path to my .ipa archive directory on a shared computer"
Customer="(relative path inside archive directories)"
Fleet="(Continued relative path)"
PathToProject="(path to the folder on my Mac with the xcode project file)"
ProjectName="(project name).xcodeproj"
PlistPath="$Scheme-Info.plist"
appScheme="$Scheme"
AppName="(The name that I want to give my .ipa file)"
Version="(The version number for this build)"
AppendedFileName="-QA" //I use this for QA and Production distinction
exportPath="$InstallSavePath/$Fleet/$Customer/$Version$AppendedFileName/"
CompanyAppIdentifierPrefix="(my generic provisioning profile identifier)"
ArchiveLocation="$WindowsSavePath/$Fleet/$Customer/$Version$AppendedFileName"
SourceCodeDestination="(my compiled absolute path to the archive directories)"
This is all contained in a SetVariables.sh file. Now we get to start building the project. In another .sh file first I call the SetVariables file, then I start compilation:
#Update the version number in the plist file for the project
/usr/libexec/PListBuddy -c "Set :CFBundleShortVersionString $Version" "$PathToProject/$PlistPath"
/usr/libexec/PListBuddy -c "Set :CFBundleVersion $BuildVersion" "$PathToProject/$PlistPath"
#Now build and archive the project, the create the .ipa file for either submittal or giving to customers
mkdir -p "$exportPath"
mkdir -p "${ArchiveLocation}/dSYM"
xcodebuild -project "$PathToProject/$ProjectName" -scheme "$Scheme" DSTROOT="$exportPath" DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" DWARF_DSYM_FOLDER_PATH="${ArchiveLocation}/dSYM" archive -archivePath "$exportPath${appScheme} $Version$AppendedFileName.xcarchive"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${exportPath}Applications/${AppName}.app" -o "${exportPath}${appScheme} $Version$AppendedFileName.ipa"
#Now resign and create an internal dev version to test on development ipads
rm -r Payload SwiftSupport
unzip -q "${exportPath}${appScheme} $Version$AppendedFileName.ipa"
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "Payload/${AppName}.app/Info.plist")
. ./CreateInternalEntitlements.sh "$CompanyAppIdentifierPrefix.$BUNDLE_ID"
. ./resign.sh "${exportPath}${appScheme} $Version$AppendedFileName.ipa" "${exportPath}${appScheme} ${Version}${AppendedFileName} Internal" internalDev.mobileprovision "(My developer account tied to the internal provisioning profile" Entitlements.plist
rm -r Payload SwiftSupport
#Now delete the intermediate files from the installs directory
rm -rf "$exportPath${appScheme} $Version$AppendedFileName.xcarchive"
rm -rf "${exportPath}Applications"
I have left out a few things in there (resign.sh, createentitlements.sh), but those processes I found on stackoverflow, so it shouldn't be too hard for you to find as well.
I've never done it, but I'm relatively certain that you can change the command line arguments for the xcodebuild to build either release or debug like you are trying to do. You could also run the xcodebuild twice, once for debug and once for release, and save the builds to different locations.
I hope this helps you at least a little with your goals. This took my a week or two to put all together and get working for my needs. Good luck.
Python for Android (Py4A 2.6) is wonderful!!! But QPython (2.7) is a lot more powerful and continuously developed. Now I try to integrate Qpython's Python into Android (5.1 CM12) Terminal / ADB described in this Tutorial:http://wiki.qpython.org/en/diveinto/
My Script to import the environment variables qpython needs looks like:
TERM=screen
PATH=/data/data/com.hipipal.qpyplus/files/bin:/system/bin:/system/xbin
LD_LIBRARY_PATH=.:/data/data/com.hipipal.qpyplus/files/lib/:/data/data/com.hipipal.qpyplus/files/:/data/data/com.hipipal.qpyplus/lib/
PYTHONHOME=/data/data/com.hipipal.qpyplus/files
ANDROID_PRIVATE=/data/data/com.hipipal.qpyplus/files
PYTHONPATH=/storage/emulated/0/com.hipipal.qpyplus/lib/python2.7/site-packages/:/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/:/data/data/com.hipipal.qpyplus/files/lib/python2.7/:/data/data/com.hipipal.qpyplus/files/lib/python27.zip:/data/data/com.hipipal.qpyplus/files/lib/python2.7/lib-dynload/:/storage/emulated/0/com.hipipal.qpyplus/scripts
PYTHONSTARTUP=/storage/emulated/0/com.hipipal.qpyplus/lib/python2.7/site-packages/qpythoninit.py
PYTHONOPTIMIZE=2
TMPDIR=/storage/emulated/0/com.hipipal.qpyplus/cache
AP_HOST=127.0.0.1
AP_PORT=58418
AP_HANDSHAKE=01805a68-c04c-4e21-bd54-ac8732f3a8da
ANDROID_PUBLIC=/storage/emulated/0/com.hipipal.qpyplus
ANDROID_PRIVATE=/data/data/com.hipipal.qpyplus/files
ANDROID_ARGUMENT=/storage/emulated/0/com.hipipal.qpyplus/scripts
Shell session:
u0_a101#C1905:/ $ source /sdcard/qpyenvnew.sh
u0_a101#C1905:/ $ $python
u0_a101#C1905:/ $ hmm do nothing?!
I get no output.
I have found here on Stackoverflow the same Question but the posted solution ist a link how is down.
Other Tutorial on throws only errors
http://dinostest.com/node/28
Try this command in your terminal:
$sh data/data/com.hipipal.qpyplus/files/bin/qpython.sh
Terminal will prompt a Python console.
If your script for the environment variables was obtained by running the code from the tutorial link, it should be correct.
If what you have pasted is exactly what you entered, the problem would be that you tried to run pyhton by typing $python when it should have just been python
Pre-fixing with $ is used to reference the value of a variable, so entering $python referenced the value of the variable python but does nothing with it, hence no feedback.
EDIT2: Although it's not a direct answer to this question I suggest having a look at the App 'Termux'. You can install Python2/3 via apt, virtualenv/-wrapper etc... Much more powerfull!
EDIT: Since /data/data... is only accessible as root, the following must be done as root!
Take care that the python executables path is in your $PATH. That wasn't the case even after having run the script from the tutorial (your script). If it's not present simply type:export PATH=/data/data/com.hipipal.qpyplus/files/bin:$PATH
or follow theses steps. In short: create a file in /sdcard (here ".bashrc") with the above line. After that type: source .bashrcsource init.sh (init.sh is located in /data/data/com.hipipal.qpyplus/files/bin as well) Then fire up Python with python-android5 which is the PIE compatible executable for Phone with Lollipop and above. But be aware: For whatever reason I couldn't exit() or quit() the Python prompt but I was able to run Script from the Terminal! Have fun!
EDIT: I spotted this: PythonForAndroid. It is a fork of PythonForAndroid that is still alive, and this versions are able to run on Android L (Python3 on 5.1.1 in my case). Also check the SL4A linked there, it works great on Lollipop.
Thanks to the answers above I made a super easy solution. If you have root: Create a file "python" and type the following line in it:
sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh
Place this file in your /system/bin directory and you can access python from everywhere using the command 'python'.
Please pardon my ignorance, relatively new to working with Unity3D. I am working on automating Unity3d builds from the command line.
I am looking for command line arguments to build apk & xcode project.
Unity's documentation does mention arguments to build a standalone Mac OSX player (-buildOSXPlayer) and a standalone Windows player (-buildWindowsPlayer) but not for android and iOS.
Any help would be really appreciated. Thanks.
Start with Unity's own documentation for command line builds for iOS and android.
For example, put this script in your Assets/Editor folder:
// C# example
using UnityEditor;
class Autobuilder
{
[MenuItem ("File/AutoBuilder/iOS")]
static void PerformBuild ()
{
string[] scenes = { "Assets/MyScene.unity" };
string buildPath = "../../../Build/iOS";
// Create build folder if not yet exists
Directory.CreateDirectory(buildPath);
BuildPipeline.BuildPlayer(scenes, buildPath, BuildTarget.iOS, BuildOptions.Development);
}
}
You can actually run this script in the Unity application by going to File -> Autobuilder -> iOS
To run on command line, it looks something like this:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod Autobuilder.PerformBuild -email me#email.com -password myPassword
Of course, you're going to want to check the debug log for any errors:
Mac OS X ~/Library/Logs/Unity/Editor.log
Windows XP C:\Documents and Settings\username\Local Settings\Application Data_\Unity\Editor\Editor.log
Windows Vista/7 C:\Users\username\AppData\Local\Unity\Editor\Editor.log
The -executeMethod command line parameter is a very simple option to invoke any function in any of your scripts - which you can then use to do pretty much anything, including firing off an Android build.
I'd like to see all the variables that are usable from the Condition element inside something like:
<Reference Include="FSharp.Core" Condition="'$(TargetFrameworkVersion)' == 'v4.0'">
<HintPath>..\..\lib\FSharp\FSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
How do I tell Xamarin Studio to print them out during the build? I didn't see anything like a "verbose/debug" option in the Options dialog.
(I'm using Xamarin Studio 4.1.9)
Right click on your main project in the solution -> Options.
On the left-hand side, under Build -> iOS Build you see Additional Options -> Additional mtouch arguments.
Enter -v -v -v -v for a verbose log.
PS Since i am writing this a year and a half after the question, I am talking about Xamarin Studio 5.7.1
I tried building i686-linux-android-gfortran using build-gcc.sh following this
(it's for androdindk-7b) but I get error about link.h. I added link.h from here, but it gives further more errors.
Has anyone tried enabling i686-linux-android-gfortran for x86 Android?
From https://groups.google.com/forum/#!msg/android-ndk/QR1qiN0jIpE/g0MHkhTd4YMJ as selalerer suggested. I didn't try this, so I'm posting as a community wiki for reference purposes.
Fortran for x86 Android
=================
The guide is based on this one, many thanks to Phil:
Compiling Android NDK with Objective-C-enabled gcc errors
1) Download and unpack Android NDK 'android-ndk-r8c', (the older -r8b NDK won't work due to missing link.h!):
wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2
2) Create somewhere a folder called 'toolchain-src' (e.g. inside the folder android-ndk-r8c),
'cd' to this new folder
3) Make sure to have git installed ('yum install git' or whatever..) and download
the toolchain sources:
git clone https://android.googlesource.com/toolchain/build.git
git clone https://android.googlesource.com/toolchain/gmp.git
git clone https://android.googlesource.com/toolchain/gdb.git
git clone https://android.googlesource.com/toolchain/mpc.git
git clone https://android.googlesource.com/toolchain/mpfr.git
git clone https://android.googlesource.com/toolchain/expat.git
4) Create the folder 'binutils', 'cd' to this directory, unpack
binutils-2.23 there:
wget ftp.gnu.org/gnu/binutils/binutils-2.23.tar.gz
tar -xvzf binutils-2.23.tar.gz
You should now have a folder toolchain-src/binutils/binutils-2.23
5) Change to folder toolchain-src/build, edit the Makefile.in, changing the line:
--with-gnu-as --with-gnu-ld --enable-languages=c,c++
to
--with-gnu-as --with-gnu-ld --enable-languages=c,c++,fortran
6) In the file android-ndk-r8c/build/tools/build-mingw64-toolchain.sh change the line:
var_append GCC_CONFIGURE_OPTIONS "--enable-languages=c,c++"
to
var_append GCC_CONFIGURE_OPTIONS "--enable-languages=c,c++,fortran"
7) In the file android-ndk-r8c/build/tools/build-gcc.sh, change the line:
EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --disable-libquadmath --disable-plugin"
to
EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --disable-libquadmath --disable-libquadmath-support --disable-plugin"
8) In the file android-ndk-r8c/build/tools/build-host-gcc.sh, change the line:
ARGS=$ARGS" --enable-languages=c,c++"
to
ARGS=$ARGS" --enable-languages=c,c++,fortran"
And change the line
ARGS=$ARGS" --disable-libquadmath --disable-plugin --disable-libitm --disable-bootstrap"
to
ARGS=$ARGS" --disable-libquadmath --disable-libquadmath-support --disable-plugin --disable-libitm --disable-bootstrap"
9) Build your new toolchain:
/your/path/to/android-ndk-r8c/build/tools/build-gcc.sh -j1 --gmp-version=5.0.5 --mpfr-version=2.4.2 --mpc-version=0.8.1 --binutils-version=2.23 --gdb-version=7.3.x /your/path/to/toolchain-src /your/path/to/android-ndk-r8c x86-4.7
(don't worry about messages like 'expr: warning: unportable BRE:')
10) And go down to your knees in front of the screen, praying to the Lord that somehow these
countless configure scripts doing checks that nobody needs, using an ugly shell language
that cooks your brain with indentation going from right to left, will somehow manage to
compile a zillion of far too small files (so that 10% of the time is spent on compilation
and 90% on starting up GCC), and after an hour of watching progress with
tail -F /tmp/ndk-YourUserName/build/toolchain/config.log
your toolchain will be magically ready. You'll find it in the android-ndk-r8c/toolchains folder.
11) Finally, 'cd' to the folder
'/your/path/to/android-ndk-r8c/toolchains/x86-4.7/prebuilt/linux-x86/i686-linux-android'
and run this command:
ln -s ../libexec libexec
Without this command, it may happen that g++ raises the error message
"g++: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found".
Using strace, I found that g++ looks in the wrong folder, but the link
above lets it find the file liblto_plugin.so nevertheless.
And here are a few lessons learned on the way, so that Google finds this page:
*) To speed up the compilation, you can remove the '-j1'. But only after you got
it to work once, since building in parallel on multiple CPU cores was reported to
cause additional troubles.
*) The error message "Link tests are not allowed after GCC_NO_EXECUTABLES" shows up
when linking fails for x86 (works for ARM). The reason is that GCC does not include
the proper ANDROID_STARTFILE_SPEC and ANDROID_ENDFILE_SPEC from
gcc-4.6.1/gcc/config/linux-android.h. GCC 4.6.1 only specifies them for ARM, but not
for i386, GCC 4.8.0 however does. The GCCs downloaded from Google also do,
so best use Google's GCC.
*) The error message "fatal error: link.h: No such file or directory" also happens
with Google's GCC, and apparently (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50877)
only when you enable additional languages like objc or fortran.
The bug thread is here: http://gcc.gnu.org/ml/gcc-bugs/2012-08/msg00494.html
MIPS has link.h in android-ndk-r8b/platforms/android-9/arch-mips/usr/include
In android-ndk-r8c, link.h is now also present in android-9/arch-x86/usr/include/link.h,
so this bug was fixed.
*) The error message "fatal error: quadmath_weak.h: No such file or directory":
It also happens with the latest gcc-4.8, so we can just continue using Googles GCC 4.7.
Google itself uses --disable-libquadmath, but we additionally need --disable-libquadmathsupport
(see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47648). So this needs to be added in
android-ndk-r8c/build/tools/build-gcc.sh
and
android-ndk-r8c/build/tools/build-host-gcc.sh
*) The error message "error: Pthreads are required to build libatomic"
Happens when building the ARM version of gcc-4.8 downloaded from gnu.org,
better stay with Google's GCCs.
*) The GCC that came with android-ndk-r8c didn't work for me (error message about
libstdc++.so.6 being too old), while the one in android-ndk-r8b worked
without problems. Since the android-ndk should support as many environments
as possible, I'm not sure why the Googlers decided to depend on a newer libstdc++,
but the good news are that building your own toolchain solves the issue.
*) If you get an error while compiling generic-morestack.c, then replace
#ifdef linux
// On Linux, the first two real time signals are used by the NPTL
with
#if defined(GLIBC) && defined(linux)
// On Linux, the first two real time signals are used by the NPTL