Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SwiftAndoroidを使ってシミュレータでアプリを動かした話
Search
matuyuji
January 28, 2016
Programming
0
580
SwiftAndoroidを使ってシミュレータでアプリを動かした話
SwiftAndoroidでAPKを作って、それをAndroidシミュレータで動かしてみました。
matuyuji
January 28, 2016
Tweet
Share
More Decks by matuyuji
See All by matuyuji
Emacs × Touch Bar
matuyuji
2
1.7k
ARKit + SceneKitでMinesweeperを作ってみた
matuyuji
1
760
Go + QtでiOS アプリ開発
matuyuji
0
370
@_specialized なお話し
matuyuji
0
460
Xcode Souce Code Extensionを使ってみた
matuyuji
0
330
Codebeatを 試してみた
matuyuji
0
720
React Nativeで UIコンポーネントをつくる
matuyuji
0
980
React Nativeを使ってみた
matuyuji
0
1.2k
SwiftでLens
matuyuji
1
930
Other Decks in Programming
See All in Programming
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
CSC509 Lecture 09
javiergs
PRO
0
140
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
subpath importsで始めるモック生活
10tera
0
310
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Happy Clients
brianwarren
98
6.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Designing for Performance
lara
604
68k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Visualization
eitanlees
145
15k
Transcript
4XJGU"OEPSPJEΛͬͯ γϛϡϨʔλͰΞϓϦΛಈ͔ͨ͠ ؔϞόΠϧΞϓϦݚڀձ !NBUVZVKJ
@matuyuji safx-dev.blogspot.jp
4XJGU"OESPJE
None
None
Port of Apple's reference Swift toolchain to Android; doesn't quite
work yet SwiftAndroid / swift forked from apple/swift
https://github.com/SwiftAndroid/swift/wiki/Getting-started
6CVOUV CJU
https://www.vagrantup.com
7BHSBOU
7BHSBOU vagrant init boxcutter/ubuntu1510 vagrant up vagrant ssh
/%,4XJGU"OESPJE curl -LO http://dl.google.com/android/ndk/android-ndk-r10e-linux- x86_64.bin chmod a+x android-ndk-r10e-linux-x86_64.bin ./android-ndk-r10e-linux-x86_64.bin >
/dev/null export ANDROID_NDK_HOME=$HOME/android-ndk-r10e curl -LO https://github.com/SwiftAndroid/swift/releases/download/ swiftandroid-2016-01-06/swift_android_2016-01-06.tar.xz tar xf swift_android_2016-01-06.tar.xz export PATH=$PATH:$HOME/swiftandroid/bin
$PNQJMF $ echo 'print("Hello world!")' > hello.swift $ swiftc-android hello.swift
$ file hello hello: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped
"OESPJE4%, sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get
install -y libncurses5:i386 \ libstdc++6:i386 \ zlib1g:i386 sudo apt-get install -y openjdk-7-jdk curl -LO http://dl.google.com/android/android-sdk_r24.4.1- linux.tgz tar xf android-sdk_r24.4.1-linux.tgz export ANDROID_HOME=$HOME/android-sdk-linux echo y | $ANDROID_HOME/tools/android update sdk \ —-no-ui —-all \ —-filter platform-tools,tools,android-23,build-tools-23.0.2
4XJGU"OESPJE(SBEMF git clone https://github.com/SwiftAndroid/ swift-android-gradle.git cd swift-android-gradle ./gradlew install
4XJGU"OESPJE4BNQMFT git clone https://github.com/SwiftAndroid/ swift-android-samples.git cd swift-android-samples/swifthello ./gradlew build cp
-r build/outputs/apk/ /vagrant
7BHSBOU 1SPWJTJPOJOH
TBGY4XJGU"OESPJE7BHSBOU git clone https://github.com/safx/SwiftAndroid-Vagrant.git cd SwiftAndroid-Vagrant vagrant up ls apk
vagrant halt vagrant destroy
4JNVMBUPS
4JNVMBUFPO.BD curl -LO http://dl.google.com/android/android-sdk_r24.3.4- macosx.zip unzip android-sdk_r24.3.4-macosx.zip cd android-sdk-macosx echo
y | ./tools/android update sdk -a --no-ui —-filter \ android-23,sys-img-armeabi-v7a-android-23,platform-tools ./tools/android list targets ./tools/android create avd -n my_android23 -t 1 ./tools/emulator -avd my_android23 ./platform-tools/adb install swifthello-debug.apk
None
None
4PVSDFT
NBJOTXJGU @_silgen_name("Java_net_zhuoweizhang_swifthello_SwiftHello_return42") public func return42() -> Int { return 42
}
4XJGU)FMMPKBWB public class SwiftHello extends Activity { @Override protected void
onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); loadNativeDependencies(); TextView myText = (TextView) findViewById(R.id.mytext); myText.setText("Result of swift return42() function is " + return42()); } private static void loadNativeDependencies() { System.loadLibrary("c++_shared"); System.loadLibrary("icudata"); System.loadLibrary("icui18n"); System.loadLibrary("icuuc"); // Swift System.loadLibrary("swiftCore"); System.loadLibrary("swiftGlibc"); // Our library System.loadLibrary("swifthello"); } public static native int return42(); }