如何在Windows上进行iPad flash app调试? [重复]

问题描述 投票:0回答:2

可能重复: Debugging iOS/AIR content on the device

我将我的Air应用程序移植到iPad上。我编译它:

adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore store.p12 -storepass ****** -provisioning-profile profile.mobileprovision app.ipa app.xml app.swf

应用程序通过iTunes部署在设备上。当我在iPad上启动应用程序时,我得到一个黑屏。看起来像抛出一些异常或类似的东西。我怎么能看到那个例外?或者如果更一般,你们如何在Windows上调试iOS应用程序?

ios actionscript-3 ipad air
2个回答
1
投票

据我所知,没有AIR和iOS的远程调试可能。因此,您必须恢复在某处创建滚动文本字段并在那里显示日志/调试文本。

编辑:见Debugging iOS/AIR content on the device

Edit2:通过Flash Prof CS5.5:http://www.youtube.com/watch?v=DanNBN89uhs在iOS上进行调试的简短教程视频

您可以使用uncaughtErrorEvents属性(在主文档loaderInfo属性中找到)来捕获任何未处理的错误,并在文本字段中显示它(请参阅http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html#uncaughtErrorEvents

还可以定义编译器常量以将调试日志语句包含在actionscript中,以便您可以轻松地打开和关闭它们。

我通常也会在创建iPad版本之前先在我的窗口上测试应用程序。

最后提示:请记住,只有你的主swf可以包含actionscript。

编辑:

这是一个示例,尝试在执行任何其他动作脚本之前添加此代码:

import flash.events.UncaughtErrorEvent;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldType;

// ...
// textLog contains errors
var textLog: TextField;

// make sure there is a uncaughtErrorEvents property (in case of older player)
if (this.loaderInfo.hasOwnProperty('uncaughtErrorEvents'))
{
  // listen for uncaught error events
  this.loaderInfo['uncaughtErrorEvents'].addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtError);
  // make sure text field stays on top
  this.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
  // create TextField at bottom using 1/5th of stage height
  textLog = new TextField();
  textLog.width = this.stage.stageWidth;
  textLog.height = Math.floor(0.20 * this.stage.stageHeight);
  textLog.y = this.stage.stageHeight - textLog.height;
  textLog.multiline = true;
  textLog.wordWrap = true;
  textLog.defaultTextFormat = new TextFormat('_sans', 10);
  textLog.type = TextFieldType.DYNAMIC;
  textLog.background = true;
  textLog.backgroundColor = 0xCCCCCC;
  this.addChild(textLog);
  textLog.appendText('Catching errors\n');
}

// show error and scroll to bottom line
function handleUncaughtError(anEvent: UncaughtErrorEvent): void
{
  textLog.appendText(anEvent.error + '\n');
  textLog.scrollV = textLog.maxScrollV;
}

// make sure textLog stays on top of all other children
function handleEnterFrame(anEvent: Event): void
{
  if (this.getChildIndex(this.textLog) != this.numChildren - 1)
  {
    this.addChild(this.textLog);
  }
}

0
投票

你使用的是Air 2.7还是3.0?当我使用用炼金术建造的图书馆时,我遇到了这个问题。由于某种原因使用炼金术库导致了空白屏幕。远程调试对我没有帮助,因为它在所有事情之前。我通过不包括炼金库来修复它(该库用于快速JSON解析)

© www.soinside.com 2019 - 2024. All rights reserved.