如何跨越用于x86编译的Android单 [英] How to cross compile mono for x86 android
问题描述
我已经尝试了许多不同的方式。我完成了与NDK编译,当我在与ADP外壳模拟器中运行它,我没有得到任何输出。
这是一个压缩包单3.10.0 p>
下面是我的环境变量:
出口CC = i686的-Linux的Android的GCC
出口SYSROOT = /家庭/ XXUSERNAMEXX /开发/ Android的NDK-r10d /平台/ Android的17 /拱-86
出口PATH = / tmp目录/我-的Android工具链/斌:在/ usr / local / sbin中:在/ usr / local / bin目录:/ usr / sbin目录:在/ usr / bin中:/ sbin目录:/ bin中
下面是我的配置:
的./configure --disable-MCS-建立--host = i686的-Linux的机器人前缀= /家庭/ XXUSERNAMEXX / vmshare /工作区/ HelloJni / JNI /单2.0 --target = i686的-Linux的机器人--build = i686的Linux的GNU的
然后只需
进行
,则
进行安装。
然后建立只是一个C#示例:
// HelloAndroid.cs
使用系统//输出HelloAndroid.exe
;
命名空间HelloAndroid
{
类MainClass
{
公共静态无效的主要(字串[] args)
{
Console.WriteLine(你好!世界);
}
}
}
然后我复制
单SGEN
libmonosgen-2.0.so
HelloAndroid.exe
到
的机器人目录
/data/data/com.example.helloandroid
改变所有的权限设置为755
改变所有的所有制系统:系统
然后键入
./单SGEN HelloAndroid.exe
在ADP壳
然后我就什么也得不到。
没有错误,没有输出,只需在命令行中返回
您需要编译.NET程序集(系统.DLL ...),如定期主机并把它们放进机器人。
此外定义 MONO_PATH
来单声道运行时。
I have tried many different ways. I completed a compile with the NDK and when I run it on an emulator with the adp shell, I get no output.
mono-3.10.0 from a tarball
Here are my environment variables:
export CC=i686-linux-android-gcc
export SYSROOT=/home/XXUSERNAMEXX/Develop/android-ndk-r10d/platform/android-17/arch-x86
export PATH=/tmp/my-android-toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Here is my configure:
./configure --disable-mcs-build --host=i686-linux-android --prefix=/home/XXUSERNAMEXX/vmshare/workspace/HelloJni/jni/mono-2.0 --target=i686-linux-android --build=i686-linux-gnu
then just make then make install
Then build a C# sample of just: // HelloAndroid.cs // Outputs HelloAndroid.exe using System;
namespace HelloAndroid
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
}
}
}
then I copy mono-sgen libmonosgen-2.0.so HelloAndroid.exe to an android directory of
/data/data/com.example.helloandroid
change all the permissions to 755 change all the ownerships to system:system
then type
./mono-sgen HelloAndroid.exe
in the adp shell
then I just get nothing. no errors, no output, just the command line returns
You need to compile the .NET Assemblies (System.dll ...) like for regular host and to put them into Android.
In addition define MONO_PATH
to mono runtimes.
这篇关于如何跨越用于x86编译的Android单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!