Lập trình viên hướng dẫn port iOS app sang Windows 10 sử dụng Islandwood

Hải Đại Bàng

Thất nghiệp
Staff member
Tham gia
10/2/14
Bài viết
6,324
Được thích
11,511
3796 #1

Nếu bạn đang là lập trình viên cho nền tảng iOS và cũng muốn tìm hiểu việc chuyển ứng dụng, game của mình sang Windows 10 thì Microsoft đã cung cấp một bộ công cụ có tên gọi là Project Islandwood giúp các bạn làm điều đó. Việc này cũng không quá khó khăn.

Trên trang blog của lập trình viên John Kenn đã cho đăng tải một bài viết khá chi tiết giúp bước đầu tìm hiểu và thử nghiệm Islandwood, có thể tham khảo các bước tại đây: Getting started with Project Islandwood - John's Blog - Site Home - MSDN Blogs

Những gì cần thiết để bắt đầu cũng không quá phức tạp:
  • Một máy tính Mac cài sẵn bản Xcode mới nhất.
  • Một máy tính (hoặc máy ảo) chạy Windows 10.
  • Cài đặt Visual Studio 2015, bao gồm cả bộ Windows 10 SDK (bản Community edition of Visual Studio là đủ, bản này cũng miễn phí)
  • Tải về bộ công cụ Islandwood từ GitHub.
Bên cạnh đó thì tiếp tục theo dõi các thông tin mới nhất từ các link sau:
Hy vọng sẽ có thêm ứng dụng, game được chuyển từ iOS sang Windows 10, mặc dù chưa tạo được "cơn lốc" nhưng việc này cho thấy Microsoft chưa từ bỏ kế hoạch và đây là một tin tốt.

Bản gốc bài hướng dẫn:

I recommend that you install Visual Studio and test it first. If you can create and compile an emptyBlank App (Universal Windows) app, then you are good to go.

Creating a suitable Xcode Project
Here's how to create a Windows app from an iOS app. It's hard to believe, but the trickiest part of this process is creating a suitable Xcode project. Why? Because the current version of Islandwood does not support storyboards, and as you know, storyboards are now such a fundamental way of writing iOS apps that Xcode doesn't even offer the option to create a new project without them. However, we can go back to the good old days of Xcode 5 and .XIB files by butchering an existing project. Here's how I did it.

1. Create a new Xcode project, based on an iOS Single View application.



2. Set the language to Objective-C. I select iPad as my target.

3. Delete the following files from your Xcode project:
  • Main.Storyboard
  • LaunchScreen.Storyboard
  • ViewController.m
  • ViewContoller.h


4. Open info.plist, and delete the following references:

Launch screen interface file base name

Main storyboard file base name



5. From File > New > File, create a new Cocoa Touch Class, of type UIViewController, and name itViewController. Make sure to check the Also create XIB file option.




6. In the Project target settings, delete any value for MainInterface. It needs to be blank.

7. Edit the AppDelegate.h and .m files, changing them to:





This should be enough to get a blank app working in the Simulator.

You should now try adding a UILabel and some UIButton so our app actually does something (although it's probably still no Flappy Birds).

Making a Visual Studio Solution
Now that we have a working Xcode project, we can convert it to a Windows solution.

1. Copy the entire project folder over to your Windows PC (real or virtual).

2. Open a Command Prompt, and navigate to the folder containing your Xcode project.

3. Start the vsimporter.exe app (from inside WinObjC/bin folder you obtained from GitHub).

For example, enter something like:

../../winobject/bin/vsimporter.exe

4. Watch in amazement as the new Visual Studio project is created.

It will be named <Xcode project name>-WinStore 10.sln

5. Double-click on the .sln file, to open Visual Studio and your new solution.

6. Once opened, right-click on project in the Solution Explorer view on the right, and select Set as Startup Project.

7. With Debug, Win32 and Local Machine set, click the build-and-run button (the green arrow).



8. Your app should now run as a Windows app!

What's next?

The Project Islandwood folks have promised all sorts of improvements as the project evolves. At the moment, the number of iOS frameworks supported is limited, so only simple apps can be ported automatically. Storyboards are also an important omission. If you're using 3rd party graphics or physics engines that are mostly C++ / Objective-C you might be in luck, but I was blocked by a lack of SpriteKit and other frameworks from porting some of my more interesting apps.

But, that said, work is progressing. The team is even looking for iOS devs to provide them some sample .IPA files so they can analyze them and help create a useful tool for provide a pre-conversion checklist. And the team would welcome your input via the GitHub site.
 
Last edited by a moderator:

nqk009

New Member
Tham gia
30/9/15
Bài viết
85
Được thích
41
#2
Hóng cái này hơn hóng buil mới :D
 

tranphong0223

Active Member
Tham gia
2/4/14
Bài viết
181
Được thích
50
#3
Hóng cái này hơn hóng buil mới :big_smile:
chỉ cần game và ứng dụng có đầy đủ như android or ios là đc. E củg k quan tâm đến giao diện hay cái j mới mẻ hơn đâu... Vì chạy ứng dụng quá tốt rồi...:baffle::baffle::baffle::burn_joss_stick::burn_joss_stick::burn_joss_stick:
 

Theo dõi Youtube

Thành viên online

Không có thành viên trực tuyến lúc này

Quảng Cáo

Quảng Cáo

Có thể bạn quan tâm

Top Bottom